From 1a3591920e5100ba112a19e10a09ce7a5da1ab23 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 3 Jun 2011 13:14:10 +0800 Subject: [PATCH] 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 --- drivers/mtd/nand/pxa3xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.7.4