diff options
-rw-r--r-- | arch/x86_64/kernel/smp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c index fe906ba1cf45..5885b8f044b2 100644 --- a/arch/x86_64/kernel/smp.c +++ b/arch/x86_64/kernel/smp.c | |||
@@ -520,13 +520,13 @@ asmlinkage void smp_call_function_interrupt(void) | |||
520 | 520 | ||
521 | int safe_smp_processor_id(void) | 521 | int safe_smp_processor_id(void) |
522 | { | 522 | { |
523 | int apicid, i; | 523 | unsigned apicid, i; |
524 | 524 | ||
525 | if (disable_apic) | 525 | if (disable_apic) |
526 | return 0; | 526 | return 0; |
527 | 527 | ||
528 | apicid = hard_smp_processor_id(); | 528 | apicid = hard_smp_processor_id(); |
529 | if (x86_cpu_to_apicid[apicid] == apicid) | 529 | if (apicid < NR_CPUS && x86_cpu_to_apicid[apicid] == apicid) |
530 | return apicid; | 530 | return apicid; |
531 | 531 | ||
532 | for (i = 0; i < NR_CPUS; ++i) { | 532 | for (i = 0; i < NR_CPUS; ++i) { |