Skip to contentSkip to conversation

mtd: fsl_upm: fix a memory leak in fun_chip_init error path

PATCH New Axel Lin 1 participant 1 message Jun 30, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mtd: fsl_upm: fix a memory leak in fun_chip_init error path

---
 drivers/mtd/nand/fsl_upm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mtd/nand/fsl_upm.c +2 -0
index da92fed..b4f3cc9 100644
@@ -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;
 }
 
Signature · 1 line
1.7.4.1