From 76d067ac33947f08fbbdea27bae5f3a263eda3f3 Mon Sep 17 00:00:00 2001 From: Prabhakar Kushwaha Date: Tue, 10 Apr 2012 22:48:27 +0000 Subject: [PATCH] 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 --- drivers/mtd/nand/fsl_ifc_nand.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.30.2