summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/pxa3xx_nand.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-06-03 13:14:10 +0800
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 15:01:59 +0300
commit1a3591920e5100ba112a19e10a09ce7a5da1ab23 (patch)
tree762c22759586e350bda7846baef068294bcfa8fd /drivers/mtd/nand/pxa3xx_nand.c
parentd80932b2dc497faa27e415c12f56f6ae1d087204 (diff)
downloadop-kernel-dev-1a3591920e5100ba112a19e10a09ce7a5da1ab23.zip
op-kernel-dev-1a3591920e5100ba112a19e10a09ce7a5da1ab23.tar.gz
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 <axel.lin@gmail.com> Acked-by: Lei Wen <leiwen@marvell.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/nand/pxa3xx_nand.c')
-rw-r--r--drivers/mtd/nand/pxa3xx_nand.c2
1 files changed, 1 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud