Commit 1d61dcb3 authored by Brian Norris's avatar Brian Norris

mtd: spi-nor: handle timeout errors in spi_nor_write()

The error label was unused here. It looks like we're missing at least
one case that should be doing 'goto write_err'.
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Reviewed-by: default avatarMarek Vasut <marex@denx.de>
Acked-by: default avatarHuang Shijie <shijie8@gmail.com>
parent 51983b7d
......@@ -805,7 +805,10 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len,
if (page_size > nor->page_size)
page_size = nor->page_size;
wait_till_ready(nor);
ret = wait_till_ready(nor);
if (ret)
goto write_err;
write_enable(nor);
nor->write(nor, to + i, page_size, retlen, buf + i);
......@@ -814,7 +817,7 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len,
write_err:
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return 0;
return ret;
}
static int macronix_quad_enable(struct spi_nor *nor)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment