From patchwork Tue Mar 24 00:19:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: pxa2xx-flash.c: fix memory leak Date: Mon, 23 Mar 2009 14:19:03 -0000 From: Daniel Mack X-Patchwork-Id: 24934 Message-Id: <1237853943-6472-1-git-send-email-daniel@caiaq.de> To: linux-mtd@lists.infradead.org Cc: Nicolas Pitre , Daniel Mack Signed-off-by: Daniel Mack Cc: Nicolas Pitre Acked-by: Nicolas Pitre --- drivers/mtd/maps/pxa2xx-flash.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index 771139c..9d66881 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c @@ -70,6 +70,7 @@ static int __init pxa2xx_flash_probe(struct device *dev) if (!info->map.virt) { printk(KERN_WARNING "Failed to ioremap %s\n", info->map.name); + kfree(info); return -ENOMEM; } info->map.cached = @@ -92,6 +93,7 @@ static int __init pxa2xx_flash_probe(struct device *dev) iounmap((void *)info->map.virt); if (info->map.cached) iounmap(info->map.cached); + kfree(info); return -EIO; } info->mtd->owner = THIS_MODULE;