Commit 682cae27 authored by Miquel Raynal's avatar Miquel Raynal Committed by Boris Brezillon

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

An error after nand_scan_tail() should trigger a nand_cleanup().
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
parent 43fab011
......@@ -1123,13 +1123,15 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
mtd->name = "nand";
ret = mtd_device_register(mtd, NULL, 0);
if (ret)
goto release_dma_write_chan;
goto cleanup_nand;
platform_set_drvdata(pdev, host);
dev_info(&pdev->dev, "FSMC NAND driver registration successful\n");
return 0;
cleanup_nand:
nand_cleanup(nand);
release_dma_write_chan:
if (host->mode == USE_DMA_ACCESS)
dma_release_channel(host->write_dma_chan);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment