2009-11-02 14:40:51

by Atsushi Nemoto

[permalink] [raw]
Subject: [PATCH] txx9ndfmc: Use nand_release() to free resources

This patch fixes memory leak on chip->bbt and chip->buffers.

Signed-off-by: Atsushi Nemoto <[email protected]>
---
drivers/mtd/nand/txx9ndfmc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c
index 73af832..863513c 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);
}
--
1.5.6.5


2009-11-09 09:40:57

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH] txx9ndfmc: Use nand_release() to free resources

On Mon, 2009-11-02 at 23:40 +0900, Atsushi Nemoto wrote:
> This patch fixes memory leak on chip->bbt and chip->buffers.
>
> Signed-off-by: Atsushi Nemoto <[email protected]>
> ---
> drivers/mtd/nand/txx9ndfmc.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)

Taken to the l2-mtd-2.6 tree, thanks.

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)