mtd: rawnand: tango: Fix struct clk memory leak

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Apr 24 08:59:02 PDT 2018


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=007b4e8b705a4eff184d567c5a8b496622f9e116
Commit:     007b4e8b705a4eff184d567c5a8b496622f9e116
Parent:     60cc43fc888428bb2f18f08997432d426a243338
Author:     Marc Gonzalez <marc_gonzalez at sigmadesigns.com>
AuthorDate: Thu Apr 5 14:57:59 2018 +0200
Committer:  Boris Brezillon <boris.brezillon at bootlin.com>
CommitDate: Sat Apr 21 00:24:57 2018 +0200

    mtd: rawnand: tango: Fix struct clk memory leak
    
    Use devm_clk_get() to let Linux manage struct clk memory.
    
    Fixes: 6956e2385a16 ("add tango NAND flash controller support")
    Cc: stable at vger.kernel.org
    Reported-by: Xidong Wang <wangxidong_97 at 163.com>
    Signed-off-by: Marc Gonzalez <marc_gonzalez at sigmadesigns.com>
    Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
    Signed-off-by: Boris Brezillon <boris.brezillon at bootlin.com>
---
 drivers/mtd/nand/raw/tango_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/tango_nand.c b/drivers/mtd/nand/raw/tango_nand.c
index f54518ffb36a..f2052fae21c7 100644
--- a/drivers/mtd/nand/raw/tango_nand.c
+++ b/drivers/mtd/nand/raw/tango_nand.c
@@ -645,7 +645,7 @@ static int tango_nand_probe(struct platform_device *pdev)
 
 	writel_relaxed(MODE_RAW, nfc->pbus_base + PBUS_PAD_MODE);
 
-	clk = clk_get(&pdev->dev, NULL);
+	clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 



More information about the linux-mtd-cvs mailing list