[PATCH RESEND u-boot-spi 4/8] mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase()

Marek Behún marek.behun at nic.cz
Thu Jul 15 01:51:05 CEST 2021


The cleanup code of spi_nor_erase() function calls write_disable(), but
does not return it's return value even in case of failure. Fix this.

Signed-off-by: Marek Behún <marek.behun at nic.cz>
Tested-by: Masami Hiramatsu <masami.hiramatsu at linaro.org>
---
 drivers/mtd/spi/spi-nor-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 48c82b94aa..d8cc1389e3 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -951,7 +951,9 @@ erase_err:
 	if (!ret)
 		ret = err;
 #endif
-	write_disable(nor);
+	err = write_disable(nor);
+	if (!ret)
+		ret = err;
 
 	return ret;
 }
-- 
2.31.1



More information about the U-Boot mailing list