From: Axel Lin Date: Fri, 3 Jun 2011 05:14:10 +0000 (+0800) Subject: mtd: pxa3xx_nand: fix a memory leak X-Git-Tag: next-20110726~35^2~152 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5fd75f99200c83bfe9283a1712893ecb4053fefd;p=karo-tx-linux.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;