From: Axel Lin Date: Fri, 3 Jun 2011 05:15:30 +0000 (+0800) Subject: mtd: fsmc_nand: fix a memory leak X-Git-Tag: next-20110726~35^2~151 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=02cd0a0182a20240a7d2ac25b1e1b8a202bc5921;p=karo-tx-linux.git 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 Signed-off-by: Artem Bityutskiy --- 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);