diff options
author | Catalin Marinas <catalin.marinas@gmail.com> | 2006-07-14 09:23:59 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-15 06:53:51 +0200 |
commit | a7546075e7c08821732fa04119a9005c55ab432d (patch) | |
tree | ab5265ed593dc6adece1014014a20424fd176184 /arch | |
parent | [PATCH] i386: handle_BUG(): don't print garbage if debug info unavailable (diff) | |
download | linux-a7546075e7c08821732fa04119a9005c55ab432d.tar.xz linux-a7546075e7c08821732fa04119a9005c55ab432d.zip |
[PATCH] Fix a memory leak in the i386 setup code
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | 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 7864395c1441..f1682206d304 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -1327,7 +1327,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat 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, |