mtd: fsmc_nand: fix a memory leak

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 7 11:59:05 EST 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=82e023ab4e144da7f83fe7e6c93a09be2f30ff07
Commit:     82e023ab4e144da7f83fe7e6c93a09be2f30ff07
Parent:     1a3591920e5100ba112a19e10a09ce7a5da1ab23
Author:     Axel Lin <axel.lin at gmail.com>
AuthorDate: Fri Jun 3 13:15:30 2011 +0800
Committer:  Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:01:59 2011 +0300

    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 at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
 drivers/mtd/nand/fsmc_nand.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index e9b275a..8a5f1aa 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -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);
 



More information about the linux-mtd-cvs mailing list