driver/mtd:IFC: Fix possible memory leak
if priv->bank >= MAX_BANK, priv should be freed before returning ENODEV. Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com> Signed-off-by: Scott Wood <scott@tyr.buserror.net>
This commit is contained in:
parent
807fc702e0
commit
76d067ac33
|
|
@ -775,6 +775,7 @@ int board_nand_init(struct nand_chip *nand)
|
||||||
if (priv->bank >= MAX_BANKS) {
|
if (priv->bank >= MAX_BANKS) {
|
||||||
printf("%s: address did not match any "
|
printf("%s: address did not match any "
|
||||||
"chip selects\n", __func__);
|
"chip selects\n", __func__);
|
||||||
|
kfree(priv);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue