mtd: spi-nor-core: Check return value of write_enable() in spi_nor_erase()
The spi_nor_erase() function does not check return value of the write_enable() call. Fix this. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
This commit is contained in:
parent
36384f612d
commit
5ea6dccee4
1 changed files with 3 additions and 1 deletions
|
@ -931,7 +931,9 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
|
|||
if (ret < 0)
|
||||
goto erase_err;
|
||||
#endif
|
||||
write_enable(nor);
|
||||
ret = write_enable(nor);
|
||||
if (ret < 0)
|
||||
goto erase_err;
|
||||
|
||||
ret = spi_nor_erase_sector(nor, addr);
|
||||
if (ret < 0)
|
||||
|
|
Loading…
Reference in a new issue