提交 1a359192 编写于 作者: A Axel Lin 提交者: 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: NAxel Lin <axel.lin@gmail.com>
Acked-by: NLei Wen <leiwen@marvell.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册