diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-12-25 07:39:27 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-12-25 07:39:16 -0500 |
commit | 33b1d09ef317d64c58b135c2e811bb55b3f15b19 (patch) | |
tree | 40b7448fb78f750cd7725d75c5873e49a837d03b | |
parent | 4f7e90d6d61fa0e56821787521c12f8a626c4037 (diff) |
[S390] panic_stack leak in smp_alloc_lowcore
Fix freeing of the panic_stack if the allocation of async_stack failed.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/kernel/smp.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index bf170c698f0c..1e7db1ab7453 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -500,18 +500,15 @@ static int __cpuinit smp_alloc_lowcore(int cpu) | |||
500 | 500 | ||
501 | save_area = get_zeroed_page(GFP_KERNEL); | 501 | save_area = get_zeroed_page(GFP_KERNEL); |
502 | if (!save_area) | 502 | if (!save_area) |
503 | goto out_save_area; | 503 | goto out; |
504 | lowcore->extended_save_area_addr = (u32) save_area; | 504 | lowcore->extended_save_area_addr = (u32) save_area; |
505 | } | 505 | } |
506 | #endif | 506 | #endif |
507 | lowcore_ptr[cpu] = lowcore; | 507 | lowcore_ptr[cpu] = lowcore; |
508 | return 0; | 508 | return 0; |
509 | 509 | ||
510 | #ifndef CONFIG_64BIT | ||
511 | out_save_area: | ||
512 | free_page(panic_stack); | ||
513 | #endif | ||
514 | out: | 510 | out: |
511 | free_page(panic_stack); | ||
515 | free_pages(async_stack, ASYNC_ORDER); | 512 | free_pages(async_stack, ASYNC_ORDER); |
516 | free_pages((unsigned long) lowcore, lc_order); | 513 | free_pages((unsigned long) lowcore, lc_order); |
517 | return -ENOMEM; | 514 | return -ENOMEM; |