Message ID | 20211005135606.2246-9-kabel@kernel.org |
---|---|
State | Accepted |
Commit | 1fd5e67595367126c9f76b3f0c47db21523665c3 |
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 451f289339..1e30b6cb27 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -929,6 +929,11 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) while (len) { WATCHDOG_RESET(); + if (ctrlc()) { + addr_known = false; + ret = -EINTR; + goto erase_err; + } #ifdef CONFIG_SPI_FLASH_BAR ret = write_bar(nor, addr); if (ret < 0)