diff options
-rw-r--r-- | arch/x86/kernel/smpboot.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a8fb8a980fae..e139e617f422 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -756,6 +756,14 @@ static void __cpuinit do_fork_idle(struct work_struct *work) | |||
756 | } | 756 | } |
757 | 757 | ||
758 | #ifdef CONFIG_X86_64 | 758 | #ifdef CONFIG_X86_64 |
759 | |||
760 | /* __ref because it's safe to call free_bootmem when after_bootmem == 0. */ | ||
761 | static void __ref free_bootmem_pda(struct x8664_pda *oldpda) | ||
762 | { | ||
763 | if (!after_bootmem) | ||
764 | free_bootmem((unsigned long)oldpda, sizeof(*oldpda)); | ||
765 | } | ||
766 | |||
759 | /* | 767 | /* |
760 | * Allocate node local memory for the AP pda. | 768 | * Allocate node local memory for the AP pda. |
761 | * | 769 | * |
@@ -784,8 +792,7 @@ int __cpuinit get_local_pda(int cpu) | |||
784 | 792 | ||
785 | if (oldpda) { | 793 | if (oldpda) { |
786 | memcpy(newpda, oldpda, size); | 794 | memcpy(newpda, oldpda, size); |
787 | if (!after_bootmem) | 795 | free_bootmem_pda(oldpda); |
788 | free_bootmem((unsigned long)oldpda, size); | ||
789 | } | 796 | } |
790 | 797 | ||
791 | newpda->in_bootmem = 0; | 798 | newpda->in_bootmem = 0; |