summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2006-04-06 10:16:45 +0000
committerdlg <dlg@openbsd.org>2006-04-06 10:16:45 +0000
commita770e04158f55f3a2ba232e31638f109f2dd03e6 (patch)
treed114d7772c7b80d27f934cd085d02ba196956ebd
parent-z can take no argument. (diff)
downloadwireguard-openbsd-a770e04158f55f3a2ba232e31638f109f2dd03e6.tar.xz
wireguard-openbsd-a770e04158f55f3a2ba232e31638f109f2dd03e6.zip
the synchronise cache path is unique in ami in that it uses two megaraid
commands to emulated one scsi command. i reuse the ccb and pushed it along the scsi setup path twice. when we do this for asynchronous cache syncs this happens with the timeout: timeout_set, timeout_add, timeout_set, timeout_del. from the looks of the timeout code the repeat of the timeout_set/add part can do really interesting things with the linked list holding all the timeouts. this adds a timeout_del in the middle of the two set/adds so the lists are kept sane.
-rw-r--r--sys/dev/ic/ami.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index d008c5e799e..a5527e6d537 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.142 2006/04/06 04:16:35 dlg Exp $ */
+/* $OpenBSD: ami.c,v 1.143 2006/04/06 10:16:45 dlg Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -1235,8 +1235,8 @@ ami_done_flush(struct ami_softc *sc, struct ami_ccb *ccb)
struct ami_iocmd *cmd = &ccb->ccb_cmd;
int s;
+ timeout_del(&xs->stimeout);
if (ccb->ccb_flags & AMI_CCB_F_ERR) {
- timeout_del(&xs->stimeout);
xs->error = XS_DRIVER_STUFFUP;
xs->resid = 0;
xs->flags |= ITSDONE;