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>
This commit is contained in:
committed by
Artem Bityutskiy
parent
d80932b2dc
commit
1a3591920e
@@ -1119,7 +1119,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
|
|||||||
clk_put(info->clk);
|
clk_put(info->clk);
|
||||||
|
|
||||||
if (mtd) {
|
if (mtd) {
|
||||||
mtd_device_unregister(mtd);
|
nand_release(mtd);
|
||||||
kfree(mtd);
|
kfree(mtd);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user