Skip to content

Commit 17b694a

Browse files
tititiou36Boris Brezillon
authored andcommitted
mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_probe()
If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. Fixes: 4d26f01 ("mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
1 parent bfa4133 commit 17b694a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mtd/nand/lpc32xx_mlc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
707707
}
708708
res = clk_prepare_enable(host->clk);
709709
if (res)
710-
goto err_exit1;
710+
goto err_put_clk;
711711

712712
nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl;
713713
nand_chip->dev_ready = lpc32xx_nand_device_ready;
@@ -814,6 +814,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
814814
dma_release_channel(host->dma_chan);
815815
err_exit2:
816816
clk_disable_unprepare(host->clk);
817+
err_put_clk:
817818
clk_put(host->clk);
818819
err_exit1:
819820
lpc32xx_wp_enable(host);

0 commit comments

Comments
 (0)