summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/fsmc_nand.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-06-03 07:15:30 +0200
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 14:01:59 +0200
commit82e023ab4e144da7f83fe7e6c93a09be2f30ff07 (patch)
tree67408171675ff33e0dab84e90ef13509e5a0bcf0 /drivers/mtd/nand/fsmc_nand.c
parentmtd: pxa3xx_nand: fix a memory leak (diff)
downloadlinux-82e023ab4e144da7f83fe7e6c93a09be2f30ff07.tar.xz
linux-82e023ab4e144da7f83fe7e6c93a09be2f30ff07.zip
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@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/nand/fsmc_nand.c')
-rw-r--r--drivers/mtd/nand/fsmc_nand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index e9b275ac381c..8a5f1aa2b286 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);