Skip to content

Commit

Permalink
mtd: pxa3xx_nand: fix a memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Artem Bityutskiy committed Sep 11, 2011
1 parent d80932b commit 1a35919
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/nand/pxa3xx_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a35919

Please sign in to comment.