[tip:x86/apic] x86/apic: Fix UP boot crash

From: tip-bot for Ingo Molnar
Date: Tue May 08 2012 - 00:26:44 EST


Commit-ID: 9438ef7f4ea73d5430a330fc206f97826eb9fb16
Gitweb: http://git.kernel.org/tip/9438ef7f4ea73d5430a330fc206f97826eb9fb16
Author: Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate: Mon, 7 May 2012 19:19:56 +0200
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitDate: Mon, 7 May 2012 19:19:56 +0200

x86/apic: Fix UP boot crash

Commit 31b3c9d72340 ("xen/x86: Implement x86_apic_ops") implemented
this:

... without considering that on UP the function pointer might be NULL.

Cc: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-3pfty0ml4yp62phbkchichh0@xxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
arch/x86/kernel/setup.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 8526317..7e67c5a 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1012,7 +1012,8 @@ void __init setup_arch(char **cmdline_p)
init_cpu_to_node();

init_apic_mappings();
- x86_io_apic_ops.init();
+ if (x86_io_apic_ops.init)
+ x86_io_apic_ops.init();

kvm_guest_init();

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/