public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix a memory leak in the i386 setup code
@ 2006-07-10 22:13 Catalin Marinas
  2006-07-10 22:25 ` Rafael J. Wysocki
  2006-07-10 22:45 ` functions returning 0 on success [was: [PATCH] Fix a memory leak in the i386 setup code] Michael Tokarev
  0 siblings, 2 replies; 7+ messages in thread
From: Catalin Marinas @ 2006-07-10 22:13 UTC (permalink / raw)
  To: linux-kernel

From: Catalin Marinas <catalin.marinas@gmail.com>

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---

 arch/i386/kernel/setup.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 08c00d2..d32d264 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1327,7 +1327,10 @@ #endif
 		res->start = e820.map[i].addr;
 		res->end = res->start + e820.map[i].size - 1;
 		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-		request_resource(&iomem_resource, res);
+		if (request_resource(&iomem_resource, res)) {
+			kfree(res);
+			continue;
+		}
 		if (e820.map[i].type == E820_RAM) {
 			/*
 			 *  We don't know which RAM region contains kernel data,

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

end of thread, other threads:[~2006-07-15 17:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-10 22:13 [PATCH] Fix a memory leak in the i386 setup code Catalin Marinas
2006-07-10 22:25 ` Rafael J. Wysocki
2006-07-11  7:47   ` Catalin Marinas
2006-07-11  8:26     ` Rafael J. Wysocki
2006-07-10 22:45 ` functions returning 0 on success [was: [PATCH] Fix a memory leak in the i386 setup code] Michael Tokarev
2006-07-10 22:49   ` Michael Tokarev
2006-07-15 17:33   ` Dmitry Torokhov

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