summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorPrabhakar Kushwaha <prabhakar@freescale.com>2012-04-10 22:48:27 +0000
committerScott Wood <scott@tyr.buserror.net>2012-05-18 18:15:24 -0500
commit76d067ac33947f08fbbdea27bae5f3a263eda3f3 (patch)
tree7f0e3495f01ae90adf3913ba2dd17cd6c92dd259 /drivers/mtd/nand
parent807fc702e0b09ac7bc335acfd3b0f54f9f08b643 (diff)
downloadu-boot-imx-76d067ac33947f08fbbdea27bae5f3a263eda3f3.zip
u-boot-imx-76d067ac33947f08fbbdea27bae5f3a263eda3f3.tar.gz
u-boot-imx-76d067ac33947f08fbbdea27bae5f3a263eda3f3.tar.bz2
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>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/fsl_ifc_nand.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index a518526..b3b7c70 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;
}