diff options
author | Prabhakar Kushwaha <prabhakar@freescale.com> | 2012-04-10 22:48:27 +0000 |
---|---|---|
committer | Scott Wood <scott@tyr.buserror.net> | 2012-05-18 18:15:24 -0500 |
commit | 76d067ac33947f08fbbdea27bae5f3a263eda3f3 (patch) | |
tree | 7f0e3495f01ae90adf3913ba2dd17cd6c92dd259 /drivers | |
parent | 807fc702e0b09ac7bc335acfd3b0f54f9f08b643 (diff) | |
download | talos-obmc-uboot-76d067ac33947f08fbbdea27bae5f3a263eda3f3.tar.gz talos-obmc-uboot-76d067ac33947f08fbbdea27bae5f3a263eda3f3.zip |
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')
-rw-r--r-- | drivers/mtd/nand/fsl_ifc_nand.c | 1 |
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 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; } |