aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/time.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-07-21 04:38:40 -0400
committerIngo Molnar <mingo@kernel.org>2014-08-25 16:36:57 -0400
commita90b858cfe27a576f7e44a456af2ee432404ee8f (patch)
treef23faea480b54600de52b43acc3a60da85846713 /arch/x86/kernel/time.c
parent7be141d0554921751db103b54e9f794956aa4f65 (diff)
x86: Fix non-PC platform kernel crash on boot due to NULL dereference
Upstream commit: 95d76acc7518d5 ("x86, irq: Count legacy IRQs by legacy_pic->nr_legacy_irqs instead of NR_IRQS_LEGACY") removed reserved interrupts for the platforms that do not have a legacy IOAPIC. Which breaks the boot on Intel MID platforms such as Medfield: BUG: unable to handle kernel NULL pointer dereference at 0000003a IP: [<c107079a>] setup_irq+0xf/0x4d [ 0.000000] *pdpt = 0000000000000000 *pde = 9bbf32453167e510 The culprit is an uncoditional setting of IRQ2 which is used as cascade IRQ on legacy platforms. It seems we have to check if we have enough legacy IRQs reserved before we can call setup_irq(). The fix adds such check in native_init_IRQ() and in setup_default_timer_irq(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jiang Liu <jiang.liu@linux.intel.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Cohen <david.a.cohen@linux.intel.com> Link: http://lkml.kernel.org/r/1405931920-12871-1-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/time.c')
-rw-r--r--arch/x86/kernel/time.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
index bf7ef5ce29df..0fa29609b2c4 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -68,6 +68,8 @@ static struct irqaction irq0 = {
68 68
69void __init setup_default_timer_irq(void) 69void __init setup_default_timer_irq(void)
70{ 70{
71 if (!nr_legacy_irqs())
72 return;
71 setup_irq(0, &irq0); 73 setup_irq(0, &irq0);
72} 74}
73 75