From: Axel Lin Date: Fri, 3 Jun 2011 05:14:10 +0000 (+0800) Subject: mtd: pxa3xx_nand: fix a memory leak X-Git-Tag: v3.2-rc1~14^2~203 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a3591920e5100ba112a19e10a09ce7a5da1ab23;p=profile%2Fivi%2Fkernel-x86-ivi.git mtd: pxa3xx_nand: fix a memory leak In pxa3xx_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 Acked-by: Lei Wen Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 1fb3b3a..f7040ea 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1119,7 +1119,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) clk_put(info->clk); if (mtd) { - mtd_device_unregister(mtd); + nand_release(mtd); kfree(mtd); } return 0;