提交 a72040a9 编写于 作者: B Boris Brezillon 提交者: Greg Kroah-Hartman

mtd: spinand: Fix the error/cleanup path in spinand_init()

commit c3c7dbf4887ab3ed9d611cd1f6e16937f8700743 upstream.

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: 7529df46 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Cc: <stable@vger.kernel.org>
Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org>
Acked-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b3ce7757
...@@ -1014,11 +1014,11 @@ static int spinand_init(struct spinand_device *spinand) ...@@ -1014,11 +1014,11 @@ static int spinand_init(struct spinand_device *spinand)
for (i = 0; i < nand->memorg.ntargets; i++) { for (i = 0; i < nand->memorg.ntargets; i++) {
ret = spinand_select_target(spinand, i); ret = spinand_select_target(spinand, i);
if (ret) if (ret)
goto err_free_bufs; goto err_manuf_cleanup;
ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED); ret = spinand_lock_block(spinand, BL_ALL_UNLOCKED);
if (ret) if (ret)
goto err_free_bufs; goto err_manuf_cleanup;
} }
ret = nanddev_init(nand, &spinand_ops, THIS_MODULE); ret = nanddev_init(nand, &spinand_ops, THIS_MODULE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册