Skip to content

Commit

Permalink
mtd: fsmc_nand: fix a memory leak
Browse files Browse the repository at this point in the history
In fsmc_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>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Axel Lin authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 1a35919 commit 82e023a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/nand/fsmc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ static int fsmc_nand_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);

if (host) {
mtd_device_unregister(&host->mtd);
nand_release(&host->mtd);
clk_disable(host->clk);
clk_put(host->clk);

Expand Down

0 comments on commit 82e023a

Please sign in to comment.