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