From f9e416d366d2c3d118f9c62d989320189e545a6b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 21 Sep 2003 01:37:26 -0700 Subject: [PATCH] [PATCH] Overflow check for i386 assign_irq_vector From: James Cleverdon Some very large systems overflow the array and corrupt memory. A BUG_ON will at least flag the problem until dynamic irq_vector allocation is added. --- arch/i386/kernel/io_apic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 9426f8d59a2b3..55e5bdcc9695c 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -1143,6 +1143,7 @@ int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 }; static int __init assign_irq_vector(int irq) { static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; + BUG_ON(irq >= NR_IRQS); if (IO_APIC_VECTOR(irq) > 0) return IO_APIC_VECTOR(irq); next: -- 2.53.0