mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_probe()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Sep 19 13:59:01 PDT 2017


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=17b694a5476de09e119c517dcc3b71eff6835bdf
Commit:     17b694a5476de09e119c517dcc3b71eff6835bdf
Parent:     bfa4133795e5a0badd402dd3f58b13b3cec64a4b
Author:     Christophe JAILLET <christophe.jaillet at wanadoo.fr>
AuthorDate: Sun Sep 3 13:58:31 2017 +0200
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Sep 18 12:07:30 2017 +0200

    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: 4d26f012ab59 ("mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.")
    Signed-off-by: Christophe JAILLET <christophe.jaillet at wanadoo.fr>
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
 drivers/mtd/nand/lpc32xx_mlc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
index c3bb358..5796468 100644
--- a/drivers/mtd/nand/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_mlc.c
@@ -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;
@@ -814,6 +814,7 @@ err_exit3:
 		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);



More information about the linux-mtd-cvs mailing list