Skip to content

Commit

Permalink
[PATCH] Fix a memory leak in the i386 setup code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Catalin Marinas authored and Linus Torvalds committed Jul 15, 2006
1 parent b701533 commit a754607
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/i386/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a754607

Please sign in to comment.