diff options
author | Prabhakar Kushwaha | 2012-04-10 22:48:27 +0000 |
---|---|---|
committer | Scott Wood | 2012-05-18 18:15:24 -0500 |
commit | 76d067ac33947f08fbbdea27bae5f3a263eda3f3 (patch) | |
tree | 7f0e3495f01ae90adf3913ba2dd17cd6c92dd259 | |
parent | 807fc702e0b09ac7bc335acfd3b0f54f9f08b643 (diff) |
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>
-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 a51852608a0..b3b7c705e18 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; } |