mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
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: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
parent
122bb3cb8b
commit
5a3e8cde10
1 changed files with 4 additions and 0 deletions
|
@ -1214,9 +1214,13 @@ static int flctl_probe(struct platform_device *pdev)
|
|||
goto err_chip;
|
||||
|
||||
ret = mtd_device_register(flctl_mtd, pdata->parts, pdata->nr_parts);
|
||||
if (ret)
|
||||
goto cleanup_nand;
|
||||
|
||||
return 0;
|
||||
|
||||
cleanup_nand:
|
||||
nand_cleanup(nand);
|
||||
err_chip:
|
||||
flctl_release_dma(flctl);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
|
Loading…
Reference in a new issue