mtd: txx9ndfmc: Use nand_release to free resources
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Mon, 2 Nov 2009 14:40:48 +0000 (23:40 +0900)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 30 Nov 2009 09:47:42 +0000 (09:47 +0000)
This patch fixes memory leak on chip->bbt and chip->buffers.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/txx9ndfmc.c

index 73af8324d0d0b4e540195063c9b311dcaf875b3b..863513c3b69af5942fae4da6b135e460e2681a94 100644 (file)
@@ -429,11 +429,10 @@ static int __exit txx9ndfmc_remove(struct platform_device *dev)
                chip = mtd->priv;
                txx9_priv = chip->priv;
 
+               nand_release(mtd);
 #ifdef CONFIG_MTD_PARTITIONS
-               del_mtd_partitions(mtd);
                kfree(drvdata->parts[i]);
 #endif
-               del_mtd_device(mtd);
                kfree(txx9_priv->mtdname);
                kfree(txx9_priv);
        }