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>
This commit is contained in:
Raghav Dogra 2015-05-20 14:54:58 +05:30 committed by Scott Wood
parent 5e856fa8be
commit 6b8583b0ad

View file

@ -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;
}