From: Axel Lin Date: Thu, 30 Jun 2011 11:53:09 +0000 (+0800) Subject: mtd: fsl_upm: fix a memory leak in fun_chip_init error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a751d3155dee38cb2a8e46d8cf3fa6998b2f3239;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mtd: fsl_upm: fix a memory leak in fun_chip_init error path Signed-off-by: Axel Lin Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index da92fed9f27b..b4f3cc9f32fb 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; }