[S390] panic_stack leak in smp_alloc_lowcore
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Dec 2008 12:39:27 +0000 (13:39 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Dec 2008 12:39:16 +0000 (13:39 +0100)
Fix freeing of the panic_stack if the allocation of async_stack failed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/smp.c

index bf170c698f0c655643a1dcea6a9bead4e9e1e6b1..1e7db1ab74538129d56526bc7edb73eab621c90e 100644 (file)
@@ -500,18 +500,15 @@ static int __cpuinit smp_alloc_lowcore(int cpu)
 
                save_area = get_zeroed_page(GFP_KERNEL);
                if (!save_area)
-                       goto out_save_area;
+                       goto out;
                lowcore->extended_save_area_addr = (u32) save_area;
        }
 #endif
        lowcore_ptr[cpu] = lowcore;
        return 0;
 
-#ifndef CONFIG_64BIT
-out_save_area:
-       free_page(panic_stack);
-#endif
 out:
+       free_page(panic_stack);
        free_pages(async_stack, ASYNC_ORDER);
        free_pages((unsigned long) lowcore, lc_order);
        return -ENOMEM;