aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRaghav Dogra2015-05-20 14:54:58 +0530
committerScott Wood2015-05-22 15:45:51 -0500
commit6b8583b0adac6c8119d2fc6fd4f03ed8373b5d42 (patch)
treedafe6d0741da374e96b45c086cb5840c4310cc37 /drivers/mtd
parent5e856fa8bec49b86e680626be772dd6b6aa3e5df (diff)
nand/elbc: Memory leak fix
Freeing allocated memory to priv before returning from the function Signed-off-by: Raghav Dogra <raghav@freescale.com> [scottwood: removed unnecessary cast] Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/fsl_elbc_nand.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index e85832d319d..b3a0edbf149 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -679,6 +679,7 @@ static int fsl_elbc_chip_init(int devnum, u8 *addr)
if (priv->bank >= MAX_BANKS) {
printf("fsl_elbc_nand: address did not match any "
"chip selects\n");
+ kfree(priv);
return -ENODEV;
}