diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2021-10-05 16:56:00 +0300 |
---|---|---|
committer | Jagan Teki <jagan@amarulasolutions.com> | 2021-10-23 13:17:33 +0300 |
commit | f57277997bd8036d45337ec60b08a025a0473f89 (patch) | |
tree | 74943a09c7087d1092d4b33e02c80a133bb3ad60 /drivers | |
parent | a9d9d412e00e246dbba2076ce3c11b7a5b542a76 (diff) | |
download | u-boot-f57277997bd8036d45337ec60b08a025a0473f89.tar.xz |
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 <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |