summaryrefslogtreecommitdiff
path: root/sys/arch/alpha
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-09-30 20:18:07 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-09-30 20:18:07 +0000
commit0c032b085858f39700b24aa1c7774284fa52cbba (patch)
tree85aad10682722a52ec8eba2353cc36025b659700 /sys/arch/alpha
parentd60f5ac2a05c7298351eb975037920c7eda79580 (diff)
Fix various off-by-ones in irq number validation.
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r--sys/arch/alpha/pci/pci_eb164.c6
-rw-r--r--sys/arch/alpha/pci/pci_eb64plus.c6
-rw-r--r--sys/arch/alpha/pci/pci_kn20aa.c4
-rw-r--r--sys/arch/alpha/pci/pci_kn300.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/sys/arch/alpha/pci/pci_eb164.c b/sys/arch/alpha/pci/pci_eb164.c
index 89e4a1b9d68..e2728a6461b 100644
--- a/sys/arch/alpha/pci/pci_eb164.c
+++ b/sys/arch/alpha/pci/pci_eb164.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_eb164.c,v 1.24 2009/09/30 20:16:30 miod Exp $ */
+/* $OpenBSD: pci_eb164.c,v 1.25 2009/09/30 20:18:06 miod Exp $ */
/* $NetBSD: pci_eb164.c,v 1.27 2000/06/06 00:50:15 thorpej Exp $ */
/*-
@@ -239,7 +239,7 @@ dec_eb164_intr_string(ccv, ih)
#endif
static char irqstr[15]; /* 11 + 2 + NULL + sanity */
- if (ih > EB164_MAX_IRQ)
+ if (ih >= EB164_MAX_IRQ)
panic("dec_eb164_intr_string: bogus eb164 IRQ 0x%lx", ih);
snprintf(irqstr, sizeof irqstr, "eb164 irq %ld", ih);
return (irqstr);
@@ -266,7 +266,7 @@ dec_eb164_intr_establish(ccv, ih, level, func, arg, name)
#endif
void *cookie;
- if (ih > EB164_MAX_IRQ)
+ if (ih >= EB164_MAX_IRQ)
panic("dec_eb164_intr_establish: bogus eb164 IRQ 0x%lx", ih);
cookie = alpha_shared_intr_establish(eb164_pci_intr, ih, IST_LEVEL,
diff --git a/sys/arch/alpha/pci/pci_eb64plus.c b/sys/arch/alpha/pci/pci_eb64plus.c
index 1da819d8863..e90d344d03b 100644
--- a/sys/arch/alpha/pci/pci_eb64plus.c
+++ b/sys/arch/alpha/pci/pci_eb64plus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_eb64plus.c,v 1.13 2009/09/30 20:16:30 miod Exp $ */
+/* $OpenBSD: pci_eb64plus.c,v 1.14 2009/09/30 20:18:06 miod Exp $ */
/* $NetBSD: pci_eb64plus.c,v 1.10 2001/07/27 00:25:20 thorpej Exp $ */
/*-
@@ -183,7 +183,7 @@ dec_eb64plus_intr_string(acv, ih)
{
static char irqstr[15]; /* 11 + 2 + NULL + sanity */
- if (ih > EB64PLUS_MAX_IRQ)
+ if (ih >= EB64PLUS_MAX_IRQ)
panic("dec_eb64plus_intr_string: bogus eb64+ IRQ 0x%lx", ih);
snprintf(irqstr, sizeof irqstr, "eb64+ irq %ld", ih);
return (irqstr);
@@ -200,7 +200,7 @@ dec_eb64plus_intr_establish(acv, ih, level, func, arg, name)
{
void *cookie;
- if (ih > EB64PLUS_MAX_IRQ)
+ if (ih >= EB64PLUS_MAX_IRQ)
panic("dec_eb64plus_intr_establish: bogus eb64+ IRQ 0x%lx",
ih);
diff --git a/sys/arch/alpha/pci/pci_kn20aa.c b/sys/arch/alpha/pci/pci_kn20aa.c
index bddb3cebcc7..4864d800901 100644
--- a/sys/arch/alpha/pci/pci_kn20aa.c
+++ b/sys/arch/alpha/pci/pci_kn20aa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_kn20aa.c,v 1.25 2009/09/30 20:16:31 miod Exp $ */
+/* $OpenBSD: pci_kn20aa.c,v 1.26 2009/09/30 20:18:06 miod Exp $ */
/* $NetBSD: pci_kn20aa.c,v 1.21 1996/11/17 02:05:27 cgd Exp $ */
/*
@@ -159,7 +159,7 @@ dec_kn20aa_intr_map(pa, ihp)
}
kn20aa_irq += buspin - 1;
- if (kn20aa_irq > KN20AA_MAX_IRQ)
+ if (kn20aa_irq >= KN20AA_MAX_IRQ)
panic("pci_kn20aa_map_int: kn20aa_irq too large (%d)",
kn20aa_irq);
diff --git a/sys/arch/alpha/pci/pci_kn300.c b/sys/arch/alpha/pci/pci_kn300.c
index fc1de6cddbd..76f8b844482 100644
--- a/sys/arch/alpha/pci/pci_kn300.c
+++ b/sys/arch/alpha/pci/pci_kn300.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_kn300.c,v 1.3 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: pci_kn300.c,v 1.4 2009/09/30 20:18:06 miod Exp $ */
/* $NetBSD: pci_kn300.c,v 1.28 2005/12/11 12:16:17 christos Exp $ */
/*
@@ -180,7 +180,7 @@ dec_kn300_intr_string(ccv, ih)
int irq;
irq = ih & 0x3ff;
- if (irq > NIRQ)
+ if (irq >= NIRQ)
panic("dec_kn300_intr_string: bogus kn300 IRQ 0x%x", irq);
snprintf(irqstr, sizeof irqstr, "kn300 irq %ld", irq);
@@ -201,7 +201,7 @@ dec_kn300_intr_establish(ccv, ih, level, func, arg, name)
int irq;
irq = ih & 0x3ff;
- if (irq > NIRQ)
+ if (irq >= NIRQ)
panic("dec_kn300_intr_establish: bogus kn300 IRQ 0x%x", irq);
cookie = alpha_shared_intr_establish(kn300_pci_intr, irq, IST_LEVEL,