summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-09-22 21:39:41 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-09-22 21:39:41 +0000
commit4085d09b43964c8ebb56763bfe49d52a1ff86b70 (patch)
tree95c7d5b4e6877de37715da57ee17f461d447d792 /sys/arch/mvme88k
parentae364d8ea331da992bd261a9abb64af0b7a0d27f (diff)
Off-by-ones, from aaron@
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/dev/dart.c20
-rw-r--r--sys/arch/mvme88k/dev/ssh.c4
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c
index d77823831b0..5bdd8644add 100644
--- a/sys/arch/mvme88k/dev/dart.c
+++ b/sys/arch/mvme88k/dev/dart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dart.c,v 1.21 2003/08/21 21:48:23 miod Exp $ */
+/* $OpenBSD: dart.c,v 1.22 2003/09/22 21:39:39 miod Exp $ */
/*
* Mach Operating System
@@ -169,7 +169,7 @@ darttty(dev)
struct dartsoftc *sc;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (NULL);
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -321,7 +321,7 @@ dartstart(tp)
dev = tp->t_dev;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return;
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -446,7 +446,7 @@ dartmctl (dev, flags, how)
int s;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -555,7 +555,7 @@ dartioctl(dev, cmd, data, flag, p)
struct dartsoftc *sc;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -648,7 +648,7 @@ dartparam(tp, t)
dev = tp->t_dev;
dprintf(("dartparam: setting param for dev(%d, %d)\n", major(dev), minor(dev)));
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -822,7 +822,7 @@ dartopen (dev, flag, mode, p)
struct tty *tp;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *) dart_cd.cd_devs[0]; /* the only one */
@@ -885,7 +885,7 @@ dartclose (dev, flag, mode, p)
int port;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -909,7 +909,7 @@ dartread (dev, uio, flag)
struct dartsoftc *sc;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *) dart_cd.cd_devs[0];
@@ -933,7 +933,7 @@ dartwrite(dev, uio, flag)
struct dartsoftc *sc;
port = DART_PORT(dev);
- if (dart_cd.cd_ndevs == 0 || port > NDARTPORTS)
+ if (dart_cd.cd_ndevs == 0 || port >= NDARTPORTS)
return (ENODEV);
sc = (struct dartsoftc *)dart_cd.cd_devs[0];
diff --git a/sys/arch/mvme88k/dev/ssh.c b/sys/arch/mvme88k/dev/ssh.c
index 9e8bd9fe18d..d47a7f8d869 100644
--- a/sys/arch/mvme88k/dev/ssh.c
+++ b/sys/arch/mvme88k/dev/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.14 2003/06/02 23:27:52 millert Exp $ */
+/* $OpenBSD: ssh.c,v 1.15 2003/09/22 21:39:39 miod Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@@ -1193,7 +1193,7 @@ ssh_checkintr(sc, istat, dstat, sstat0, status)
n = (n - Ent_dataout) / 16;
else
n = (n - Ent_datain) / 16;
- if (n <= 0 && n > DMAMAXIO)
+ if (n <= 0 || n >= DMAMAXIO)
printf("TEMP invalid %d\n", n);
else {
acb->iob_curbuf = (u_long)acb->ds.chain[n].databuf;