From: Atsushi Nemoto Date: Mon, 2 Nov 2009 14:40:48 +0000 (+0900) Subject: mtd: txx9ndfmc: Use nand_release to free resources X-Git-Tag: v2.6.33-rc1~66^2~41 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6eb4feffb9d619a44fe434e777ef095a29cf4759;p=karo-tx-linux.git mtd: txx9ndfmc: Use nand_release to free resources This patch fixes memory leak on chip->bbt and chip->buffers. Signed-off-by: Atsushi Nemoto Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c index 73af8324d0d0..863513c3b69a 100644 --- a/drivers/mtd/nand/txx9ndfmc.c +++ b/drivers/mtd/nand/txx9ndfmc.c @@ -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); }