From: Tejun Heo Date: Mon, 22 Jun 2009 02:56:24 +0000 (+0900) Subject: x86: fix duplicate free in setup_pcpu_remap() failure path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c5806df9232d2a7f554b4839b57cac2e664fc256;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git x86: fix duplicate free in setup_pcpu_remap() failure path 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 Cc: Ingo Molnar --- diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 9c3f0823e6aa..dfbc7e6c64d4 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) enomem: for_each_possible_cpu(cpu) if (pcpur_ptrs[cpu]) - free_bootmem(__pa(pcpur_ptrs[cpu]), PMD_SIZE); + free_bootmem(__pa(pcpur_ptrs[cpu]), pcpur_size); ret = -ENOMEM; out_free_ar: free_bootmem(__pa(pcpur_ptrs), ptrs_size);