From patchwork Tue Mar 24 00:19:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 24934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E818ADDE1A for ; Tue, 24 Mar 2009 11:21:59 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1LluMa-00063x-5C; Tue, 24 Mar 2009 00:19:28 +0000 Received: from buzzloop.caiaq.de ([212.112.241.133]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1LluMS-00063V-3y for linux-mtd@lists.infradead.org; Tue, 24 Mar 2009 00:19:26 +0000 Received: from localhost (localhost [127.0.0.1]) by buzzloop.caiaq.de (Postfix) with ESMTP id 052A17F404F; Tue, 24 Mar 2009 01:19:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at buzzloop.caiaq.de Received: from buzzloop.caiaq.de ([127.0.0.1]) by localhost (buzzloop.caiaq.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cHXwszZ5s0ol; Tue, 24 Mar 2009 01:19:09 +0100 (CET) Received: from localhost.localdomain (pd95699b2.dip0.t-ipconnect.de [217.86.153.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by buzzloop.caiaq.de (Postfix) with ESMTPSA id F26E97F401B; Tue, 24 Mar 2009 01:19:08 +0100 (CET) From: Daniel Mack To: linux-mtd@lists.infradead.org Subject: [PATCH] pxa2xx-flash.c: fix memory leak Date: Tue, 24 Mar 2009 01:19:03 +0100 Message-Id: <1237853943-6472-1-git-send-email-daniel@caiaq.de> X-Mailer: git-send-email 1.6.2 X-Spam-Score: 0.0 (/) Cc: Nicolas Pitre , Daniel Mack X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;