All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: linux-mtd@lists.infradead.org
Cc: Nicolas Pitre <nico@cam.org>, Daniel Mack <daniel@caiaq.de>
Subject: [PATCH] pxa2xx-flash.c: fix memory leak
Date: Tue, 24 Mar 2009 01:19:03 +0100	[thread overview]
Message-ID: <1237853943-6472-1-git-send-email-daniel@caiaq.de> (raw)


Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Nicolas Pitre <nico@cam.org>
---
 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;
-- 
1.6.2

             reply	other threads:[~2009-03-24  0:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24  0:19 Daniel Mack [this message]
2009-03-24  0:22 ` [PATCH] pxa2xx-flash.c: fix memory leak Nicolas Pitre
2009-03-24  0:31   ` Daniel Mack
2009-03-24  0:51     ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1237853943-6472-1-git-send-email-daniel@caiaq.de \
    --to=daniel@caiaq.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.