Message ID | 20211005135606.2246-3-kabel@kernel.org |
---|---|
State | Accepted |
Commit | 5ea6dccee45ab941cfc78fbbfd9600ef24c5ca60 |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show |
Series | Fix `mtd erase` when used with mtdpart | expand |
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index d1e2bb47f7..11255aaab0 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -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)