Skip to content

Commit bbbe279

Browse files
juhosggregkh
authored andcommitted
mtd: spinand: propagate spinand_wait() errors from spinand_write_page()
commit 091d9e3 upstream. Since commit 3d1f08b ("mtd: spinand: Use the external ECC engine logic") the spinand_write_page() function ignores the errors returned by spinand_wait(). Change the code to propagate those up to the stack as it was done before the offending change. Cc: stable@vger.kernel.org Fixes: 3d1f08b ("mtd: spinand: Use the external ECC engine logic") Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5a3a4e4 commit bbbe279

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/mtd/nand/spi/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,10 @@ int spinand_write_page(struct spinand_device *spinand,
688688
SPINAND_WRITE_INITIAL_DELAY_US,
689689
SPINAND_WRITE_POLL_DELAY_US,
690690
&status);
691-
if (!ret && (status & STATUS_PROG_FAILED))
691+
if (ret)
692+
return ret;
693+
694+
if (status & STATUS_PROG_FAILED)
692695
return -EIO;
693696

694697
return nand_ecc_finish_io_req(nand, (struct nand_page_io_req *)req);

0 commit comments

Comments
 (0)