Commit 1a359192 authored by Axel Lin's avatar Axel Lin Committed by Artem Bityutskiy

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: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarLei Wen <leiwen@marvell.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent d80932b2
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment