diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/irq.c | 6 | ||||
-rw-r--r-- | arch/x86_64/kernel/irq.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index c703bc7..9eec943 100644 --- a/arch/i386/kernel/irq.c +++ b/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/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index 3be0a7e..bfa82f5 100644 --- a/arch/x86_64/kernel/irq.c +++ b/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 |