Skip to content

Commit

Permalink
mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_pr…
Browse files Browse the repository at this point in the history
…obe()

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 <christophe.jaillet@wanadoo.fr>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  • Loading branch information
Christophe JAILLET authored and Boris Brezillon committed Sep 18, 2017
1 parent bfa4133 commit 17b694a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mtd/nand/lpc32xx_mlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
}
res = clk_prepare_enable(host->clk);
if (res)
goto err_exit1;
goto err_put_clk;

nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl;
nand_chip->dev_ready = lpc32xx_nand_device_ready;
Expand Down Expand Up @@ -814,6 +814,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
dma_release_channel(host->dma_chan);
err_exit2:
clk_disable_unprepare(host->clk);
err_put_clk:
clk_put(host->clk);
err_exit1:
lpc32xx_wp_enable(host);
Expand Down

0 comments on commit 17b694a

Please sign in to comment.