From f57277997bd8036d45337ec60b08a025a0473f89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Beh=C3=BAn?= Date: Tue, 5 Oct 2021 15:56:00 +0200 Subject: [PATCH] mtd: spi-nor-core: Check return value of write_disable() in spi_nor_erase() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- 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 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; } -- 2.39.5