mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 15:44:13 +08:00
mtd: rawnand: lpc32xx_mlc: fix the probe function error path
An error after nand_scan_tail() should trigger a nand_cleanup() and not a nand_release(). The latter doing an mtd_device_unregister() which is not needed if mtd_device_register() failed. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
parent
ed64cb1df4
commit
838c07b05b
@ -806,12 +806,12 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
|
||||
res = mtd_device_register(mtd, host->ncfg->parts,
|
||||
host->ncfg->num_parts);
|
||||
if (res)
|
||||
goto release_nand;
|
||||
goto cleanup_nand;
|
||||
|
||||
return 0;
|
||||
|
||||
release_nand:
|
||||
nand_release(mtd);
|
||||
cleanup_nand:
|
||||
nand_cleanup(nand_chip);
|
||||
free_irq:
|
||||
free_irq(host->irq, host);
|
||||
release_dma_chan:
|
||||
|
Loading…
Reference in New Issue
Block a user