[PATCH 4.16 058/113] mtd: rawnand: tango: Fix struct clk memory leak
From: Greg Kroah-Hartman
Date: Mon Apr 30 2018 - 15:44:50 EST
4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Gonzalez <marc_gonzalez@xxxxxxxxxxxxxxxx>
commit 007b4e8b705a4eff184d567c5a8b496622f9e116 upstream.
Use devm_clk_get() to let Linux manage struct clk memory.
Fixes: 6956e2385a16 ("add tango NAND flash controller support")
Cc: stable@xxxxxxxxxxxxxxx
Reported-by: Xidong Wang <wangxidong_97@xxxxxxx>
Signed-off-by: Marc Gonzalez <marc_gonzalez@xxxxxxxxxxxxxxxx>
Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/mtd/nand/tango_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mtd/nand/tango_nand.c
+++ b/drivers/mtd/nand/tango_nand.c
@@ -643,7 +643,7 @@ static int tango_nand_probe(struct platf
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);