summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2005-11-10 14:35:14 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2005-11-10 14:35:14 +0000
commit19ab602563366a1d3a1ba73ec13c9185d26d4cfc (patch)
tree58ae02d5df056a898f6f1de8afb01d25398249c9 /sys/arch/i386
parentffcb581787bac33aba3d08403e42313fbfb5f76d (diff)
do not use the array index before a range check is done
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/ioapic.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/ioapic.c b/sys/arch/i386/i386/ioapic.c
index abb77edfb6e..3bddb3b3881 100644
--- a/sys/arch/i386/i386/ioapic.c
+++ b/sys/arch/i386/i386/ioapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioapic.c,v 1.5 2004/08/12 06:11:57 niklas Exp $ */
+/* $OpenBSD: ioapic.c,v 1.6 2005/11/10 14:35:13 mickey Exp $ */
/* $NetBSD: ioapic.c,v 1.7 2003/07/14 22:32:40 lukem Exp $ */
/*-
@@ -611,7 +611,6 @@ apic_intr_establish(int irq, int type, int level, int (*ih_fun)(void *),
if ((irq & APIC_INT_VIA_APIC) == 0)
panic("apic_intr_establish of non-apic interrupt 0x%x", irq);
- pin = &sc->sc_pins[intr];
if (intr >= sc->sc_apic_sz || type == IST_NONE)
panic("apic_intr_establish: bogus intr or type");
@@ -620,7 +619,7 @@ apic_intr_establish(int irq, int type, int level, int (*ih_fun)(void *),
if (ih == NULL)
panic("apic_intr_establish: can't malloc handler info");
-
+ pin = &sc->sc_pins[intr];
switch (pin->ip_type) {
case IST_NONE:
pin->ip_type = type;