From: Marek BehĂșn Date: Tue, 5 Oct 2021 13:56:00 +0000 (+0200) Subject: mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=f57277997bd8036d45337ec60b08a025a0473f89;p=u-boot.git mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase() 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 Reviewed-by: Simon Glass Tested-by: Masami Hiramatsu --- diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index d8eed595b7..30c54cd7b9 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -953,7 +953,9 @@ erase_err: if (!ret) ret = err; #endif - write_disable(nor); + err = write_disable(nor); + if (!ret) + ret = err; return ret; }