Skip to content

Commit c3c7dbf

Browse files
committed
mtd: spinand: Fix the error/cleanup path in spinand_init()
The manufacturer specific initialization has already been done when block unlocking takes place, and if anything goes wrong during this procedure we should call spinand_manufacturer_cleanup(). Fixes: 7529df4 ("mtd: nand: Add core infrastructure to support SPI NANDs") Cc: <stable@vger.kernel.org> Signed-off-by: Boris Brezillon <bbrezillon@kernel.org> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 13c15e0 commit c3c7dbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/nand/spi/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,11 +1016,11 @@ static int spinand_init(struct spinand_device *spinand)
10161016
for (i = 0; i < nand->memorg.ntargets; i++) {
10171017
ret = spinand_select_target(spinand, i);
10181018
if (ret)
1019-
goto err_free_bufs;
1019+
goto err_manuf_cleanup;
10201020

10211021
ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED);
10221022
if (ret)
1023-
goto err_free_bufs;
1023+
goto err_manuf_cleanup;
10241024
}
10251025

10261026
ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);

0 commit comments

Comments
 (0)