From: Prabhakar Kushwaha Date: Tue, 10 Apr 2012 22:48:27 +0000 (+0000) Subject: driver/mtd:IFC: Fix possible memory leak X-Git-Tag: v2012.07-rc1~142^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=76d067ac33947f08fbbdea27bae5f3a263eda3f3;p=u-boot driver/mtd:IFC: Fix possible memory leak if priv->bank >= MAX_BANK, priv should be freed before returning ENODEV. Signed-off-by: Prabhakar Kushwaha Signed-off-by: Scott Wood --- diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index a51852608a..b3b7c705e1 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -775,6 +775,7 @@ int board_nand_init(struct nand_chip *nand) if (priv->bank >= MAX_BANKS) { printf("%s: address did not match any " "chip selects\n", __func__); + kfree(priv); return -ENODEV; }