mtd: fsmc_nand: fix a memory leak
authorAxel Lin <axel.lin@gmail.com>
Fri, 3 Jun 2011 05:15:30 +0000 (13:15 +0800)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Sun, 11 Sep 2011 12:01:59 +0000 (15:01 +0300)
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>
drivers/mtd/nand/fsmc_nand.c

index e9b275a..8a5f1aa 100644 (file)
@@ -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);