From: Raghav Dogra Date: Wed, 20 May 2015 09:24:58 +0000 (+0530) Subject: nand/elbc: Memory leak fix X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=6b8583b0adac6c8119d2fc6fd4f03ed8373b5d42;p=u-boot.git 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 --- 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; }