diff options
| author | Marek BehĂșn <[email protected]> | 2021-10-05 15:55:57 +0200 |
|---|---|---|
| committer | Jagan Teki <[email protected]> | 2021-10-23 15:47:33 +0530 |
| commit | 36384f612da992ab485c4b7cd768a89e8c3fe8cf (patch) | |
| tree | ef7113f861329df7cc75674e6d5f48a28c51588c /drivers | |
| parent | e66c6f10272cba050068017081b0996a9fa8b786 (diff) | |
mtd: spi-nor-core: Try cleaning up in case writing BAR failed
Use the cleanup codepath of spi_nor_erase() also in the event of failure
of writing the BAR register.
Signed-off-by: Marek BehĂșn <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
Reviewed-by: Pratyush Yadav <[email protected]>
Tested-by: Masami Hiramatsu <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 7572be5e34f..6da7dc3a256 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -929,7 +929,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) #ifdef CONFIG_SPI_FLASH_BAR ret = write_bar(nor, addr); if (ret < 0) - return ret; + goto erase_err; #endif write_enable(nor); |
