mtd: spi-nor-core: Don't overwrite return value if it is non-zero
authorMarek Behún <marek.behun@nic.cz>
Tue, 5 Oct 2021 13:55:59 +0000 (15:55 +0200)
committerJagan Teki <jagan@amarulasolutions.com>
Sat, 23 Oct 2021 10:17:33 +0000 (15:47 +0530)
commita9d9d412e00e246dbba2076ce3c11b7a5b542a76
treecd3aa28c934dfbfb0a484b51e0992ef1a4cacefc
parent5ea6dccee45ab941cfc78fbbfd9600ef24c5ca60
mtd: spi-nor-core: Don't overwrite return value if it is non-zero

The cleanup code of the spi_nor_erase() function overwrites the ret
variable with return value of clean_bar(), even if the ret variable is
already set. 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>
drivers/mtd/spi/spi-nor-core.c