summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2003-04-12 01:16:58 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2003-04-12 01:16:58 +0000
commitf8d882d08c73c961ba44aa348bb51a28509ca3e7 (patch)
tree771fc9c05731e151b9b183b1117965880dc7ed61 /sys
parentaa6a63973b532710eb333e9b5e7e31a1beb44b2f (diff)
Fix index bounds checking in save data pointers logic.
Fix an indent problem and an extra blank space. ok mickey@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/osiop.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c
index 3d729514bd2..72900c9455b 100644
--- a/sys/dev/ic/osiop.c
+++ b/sys/dev/ic/osiop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osiop.c,v 1.8 2003/04/11 02:00:49 krw Exp $ */
+/* $OpenBSD: osiop.c,v 1.9 2003/04/12 01:16:57 krw Exp $ */
/* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */
/*
@@ -1422,7 +1422,7 @@ osiop_checkintr(sc, istat, dstat, sstat0, status)
n = (n - Ent_dataout) / 16;
else
n = (n - Ent_datain) / 16;
- if (n <= 0 && n > OSIOP_NSG)
+ if (n < 0 || n >= OSIOP_NSG)
printf("TEMP invalid %ld\n", n);
else {
acb->curaddr = ds->data[n].addr;
@@ -1446,7 +1446,6 @@ osiop_checkintr(sc, istat, dstat, sstat0, status)
*/
if (acb->curlen > 0) {
int i, j;
-
#ifdef OSIOP_DEBUG
if (osiop_debug & DEBUG_DISC)
printf("%s: adjusting DMA chain\n",
@@ -1484,10 +1483,11 @@ osiop_checkintr(sc, istat, dstat, sstat0, status)
i < OSIOP_NSG && ds->data[i].count > 0;
i++, j++) {
#ifdef OSIOP_DEBUG
- if (osiop_debug & DEBUG_DISC)
- printf(" chain[%d]: %x/%x -> %x/%x\n", j,
- ds->data[j].addr, ds->data[j].count,
- ds->data[i].addr, ds->data[i].count);
+ if (osiop_debug & DEBUG_DISC)
+ printf(" chain[%d]: %x/%x -> %x/%x\n",
+ j,
+ ds->data[j].addr, ds->data[j].count,
+ ds->data[i].addr, ds->data[i].count);
#endif
ds->data[j].addr = ds->data[i].addr;
ds->data[j].count = ds->data[i].count;