[PATCH 1/7] x86: fix duplicate free in setup_pcpu_remap() failure path

From: Tejun Heo
Date: Tue Jun 16 2009 - 23:53:22 EST

In the failure path, setup_pcpu_remap() tries to free the area which
has already been freed to make holes in the large page. Fix it.

[ Impact: fix duplicate free in failure path ]

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
arch/x86/kernel/setup_percpu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 9c3f082..dfbc7e6 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -228,7 +228,7 @@ static ssize_t __init setup_pcpu_remap(size_t static_size)
if (pcpur_ptrs[cpu])
- free_bootmem(__pa(pcpur_ptrs[cpu]), PMD_SIZE);
+ free_bootmem(__pa(pcpur_ptrs[cpu]), pcpur_size);
ret = -ENOMEM;
free_bootmem(__pa(pcpur_ptrs), ptrs_size);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/