[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1307078130.4167.3.camel@phoenix>
Date: Fri, 03 Jun 2011 13:15:30 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Viresh Kumar <viresh.kumar@...com>,
Linus Walleij <linus.walleij@...ricsson.com>,
Shiraz Hashim <shiraz.hashim@...com>,
David Woodhouse <dwmw2@...radead.org>,
Artem Bityutskiy <Artem.Bityutskiy@...ia.com>,
linux-mtd@...ts.infradead.org
Subject: [PATCH 2/2] mtd: fsmc_nand: fix a memory leak
In fsmc_nand_remove, we should call nand_release instead of
mtd_device_unregister to properly free bad block table memory
and bad block descriptor memory.
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
drivers/mtd/nand/fsmc_nand.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index e9b275a..8a5f1aa 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -822,7 +822,7 @@ static int fsmc_nand_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
if (host) {
- mtd_device_unregister(&host->mtd);
+ nand_release(&host->mtd);
clk_disable(host->clk);
clk_put(host->clk);
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists