Patchwork mtd: ndfc: fix a memory leak in ndfc_remove

login
register
mail settings
Submitter Axel Lin
Date June 7, 2011, 2:55 p.m.
Message ID <1307458521.22584.1.camel@phoenix>
Download mbox | patch
Permalink /patch/99220/
State Accepted
Commit 96166056076af59d40e5b5aec5b09611c74cc911
Headers show

Comments

Axel Lin - June 7, 2011, 2:55 p.m.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/mtd/nand/ndfc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Artem Bityutskiy - June 8, 2011, 11:08 a.m.
On Tue, 2011-06-07 at 22:55 +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
>  drivers/mtd/nand/ndfc.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Pushed to l2-mtd-2.6.git, thanks!

Patch

diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index ea2dea8..7995470 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -288,6 +288,7 @@  static int __devexit ndfc_remove(struct platform_device *ofdev)
 	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);
 
 	nand_release(&ndfc->mtd);
+	kfree(ndfc->mtd.name);
 
 	return 0;
 }