From: Marek Behún <marek.be...@nic.cz>

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.be...@nic.cz>
Reviewed-by: Simon Glass <s...@chromium.org>
Tested-by: Masami Hiramatsu <masami.hirama...@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 a6007acd1a..d49f7faf99 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.32.0

Reply via email to