提交 5a3e8cde 编写于 作者: M Miquel Raynal 提交者: Boris Brezillon

mtd: rawnand: sh_flctl: fix the probe function error path

An error after nand_scan_tail() should trigger a nand_cleanup().
The helper mtd_device_parse_register() returns an error code that should
be checked and nand_cleanup() called accordingly.
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
上级 122bb3cb
...@@ -1214,9 +1214,13 @@ static int flctl_probe(struct platform_device *pdev) ...@@ -1214,9 +1214,13 @@ static int flctl_probe(struct platform_device *pdev)
goto err_chip; goto err_chip;
ret = mtd_device_register(flctl_mtd, pdata->parts, pdata->nr_parts); ret = mtd_device_register(flctl_mtd, pdata->parts, pdata->nr_parts);
if (ret)
goto cleanup_nand;
return 0; return 0;
cleanup_nand:
nand_cleanup(nand);
err_chip: err_chip:
flctl_release_dma(flctl); flctl_release_dma(flctl);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册