* [PATCH] mtd: fsl_upm: fix a memory leak in fun_chip_init error path
@ 2011-06-30 11:53 ` Axel Lin
0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2011-06-30 11:53 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mtd, Anton Vorontsov, David Woodhouse, Artem Bityutskiy
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/mtd/nand/fsl_upm.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index da92fed..b4f3cc9 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -196,6 +196,8 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
ret = mtd_device_parse_register(&fun->mtd, NULL, &ppdata, NULL, 0);
err:
of_node_put(flash_np);
+ if (ret)
+ kfree(fun->mtd.name);
return ret;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] mtd: fsl_upm: fix a memory leak in fun_chip_init error path
@ 2011-06-30 11:53 ` Axel Lin
0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2011-06-30 11:53 UTC (permalink / raw)
To: linux-kernel
Cc: Anton Vorontsov, David Woodhouse, Artem Bityutskiy, linux-mtd
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/mtd/nand/fsl_upm.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index da92fed..b4f3cc9 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -196,6 +196,8 @@ static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
ret = mtd_device_parse_register(&fun->mtd, NULL, &ppdata, NULL, 0);
err:
of_node_put(flash_np);
+ if (ret)
+ kfree(fun->mtd.name);
return ret;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-30 11:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-30 11:53 [PATCH] mtd: fsl_upm: fix a memory leak in fun_chip_init error path Axel Lin
2011-06-30 11:53 ` Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.