From 6b8583b0adac6c8119d2fc6fd4f03ed8373b5d42 Mon Sep 17 00:00:00 2001 From: Raghav Dogra Date: Wed, 20 May 2015 14:54:58 +0530 Subject: nand/elbc: Memory leak fix Freeing allocated memory to priv before returning from the function Signed-off-by: Raghav Dogra [scottwood: removed unnecessary cast] Signed-off-by: Scott Wood --- drivers/mtd/nand/fsl_elbc_nand.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/mtd/nand/fsl_elbc_nand.c') diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index e85832d319..b3a0edbf14 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; } -- cgit