summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2008-05-22 20:11:04 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2008-05-22 20:11:04 +0000
commit59bb12e8afde3e37eb97bd6de963666f76478514 (patch)
treebe4efd4ff35fd50838b283b6397098b12f9c2c3b /sys
parent8a0976a9100277aa851c821bbc245b6bc7e1ac9f (diff)
never schedule a timer for a negative time, if in the past schedule short delay.
please commit deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 6f561d7e346..41afc95e3cc 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.79 2007/11/06 01:05:35 krw Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.80 2008/05/22 20:11:03 drahn Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -684,8 +684,12 @@ wdc_atapi_the_machine(chp, xfer, ctxt)
}
if (retargs.expect_irq) {
+ int timeout_period;
chp->ch_flags |= WDCF_IRQ_WAIT;
- timeout_add(&chp->ch_timo, xfer->endticks - ticks);
+ timeout_period = xfer->endticks - ticks;
+ if (timeout_period < 1)
+ timeout_period = 1;
+ timeout_add(&chp->ch_timo, timeout_period);
return;
}