mtd: fsmc_nand: fix a memory leak

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>
This commit is contained in:
Axel Lin 2011-06-03 13:15:30 +08:00 committed by Artem Bityutskiy
parent 1a3591920e
commit 82e023ab4e

View File

@ -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);