public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] pxa2xx-flash.c: fix memory leak
@ 2009-03-24  0:19 Daniel Mack
  2009-03-24  0:22 ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mack @ 2009-03-24  0:19 UTC (permalink / raw)
  To: linux-mtd; +Cc: Nicolas Pitre, Daniel Mack


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-24  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24  0:19 [PATCH] pxa2xx-flash.c: fix memory leak Daniel Mack
2009-03-24  0:22 ` Nicolas Pitre
2009-03-24  0:31   ` Daniel Mack
2009-03-24  0:51     ` Nicolas Pitre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox