From e797a68fc6b12765e74a5c8faa9f1065c8cfb0b4 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 28 Jun 2006 04:26:43 -0700 Subject: [PATCH] --- yaml --- r: 30957 b: refs/heads/master c: a052b68b1e7a31f1e6a721290035e9deb0f6fed9 h: refs/heads/master i: 30955: f24140f0606f9a62e0a0e230c3524ffbd86b1d85 v: v3 --- [refs] | 2 +- trunk/arch/i386/kernel/irq.c | 6 ++++++ trunk/arch/x86_64/kernel/irq.c | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1acd5e0a2c7c..94ba8676a6d0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 79bc79b07c9c6f8ae9290704e9e503a9327fcbb2 +refs/heads/master: a052b68b1e7a31f1e6a721290035e9deb0f6fed9 diff --git a/trunk/arch/i386/kernel/irq.c b/trunk/arch/i386/kernel/irq.c index c703bc7b0880..9eec9435318e 100644 --- a/trunk/arch/i386/kernel/irq.c +++ b/trunk/arch/i386/kernel/irq.c @@ -60,6 +60,12 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs) u32 *isp; #endif + if (unlikely((unsigned)irq >= NR_IRQS)) { + printk(KERN_EMERG "%s: cannot handle IRQ %d\n", + __FUNCTION__, irq); + BUG(); + } + irq_enter(); #ifdef CONFIG_DEBUG_STACKOVERFLOW /* Debugging check for stack overflow: is there less than 1KB free? */ diff --git a/trunk/arch/x86_64/kernel/irq.c b/trunk/arch/x86_64/kernel/irq.c index 3be0a7e4bf08..bfa82f52a5cc 100644 --- a/trunk/arch/x86_64/kernel/irq.c +++ b/trunk/arch/x86_64/kernel/irq.c @@ -118,6 +118,12 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs) /* high bit used in ret_from_ code */ unsigned irq = ~regs->orig_rax; + if (unlikely(irq >= NR_IRQS)) { + printk(KERN_EMERG "%s: cannot handle IRQ %d\n", + __FUNCTION__, irq); + BUG(); + } + exit_idle(); irq_enter(); #ifdef CONFIG_DEBUG_STACKOVERFLOW