summaryrefslogtreecommitdiff
path: root/sys/dev/ic/midway.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-03-15 20:04:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-03-15 20:04:38 +0000
commitc2cf0d972013ff2806e98e0b0c283cf38ac50fd7 (patch)
tree93f7bb36a695de54b6f438979d358a61a5800169 /sys/dev/ic/midway.c
parent7a98474e0906ac069d94837486659e4625c3cf41 (diff)
Correct checks against cd_ndevs - valid numbers are strictly inferior to
cd_ndevs.
Diffstat (limited to 'sys/dev/ic/midway.c')
-rw-r--r--sys/dev/ic/midway.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/midway.c b/sys/dev/ic/midway.c
index 17f51400d47..473b658fa48 100644
--- a/sys/dev/ic/midway.c
+++ b/sys/dev/ic/midway.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: midway.c,v 1.35 2005/12/17 07:31:27 miod Exp $ */
+/* $OpenBSD: midway.c,v 1.36 2006/03/15 20:04:37 miod Exp $ */
/* (sync'd to midway.c 1.68) */
/*
@@ -3203,7 +3203,7 @@ int unit, addr, len;
struct en_softc *sc;
u_int32_t reg;
- if (unit < 0 || unit > en_cd.cd_ndevs ||
+ if (unit < 0 || unit >= en_cd.cd_ndevs ||
(sc = (struct en_softc *) en_cd.cd_devs[unit]) == NULL) {
printf("invalid unit number: %d\n", unit);
return(0);