From: Axel Lin Date: Fri, 3 Jun 2011 05:15:30 +0000 (+0800) Subject: mtd: fsmc_nand: fix a memory leak X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=82e023ab4e144da7f83fe7e6c93a09be2f30ff07;p=deliverable%2Flinux.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);