summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2004-12-20 22:07:26 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2004-12-20 22:07:26 +0000
commit4ea03d4619dc685de0a8c8225be837119dee57d7 (patch)
treee1dabad593ef908c1e4854a766122920a7c2edc6
parent413c7d9d3163235a2a09faba1dd35386098e9a77 (diff)
In the rare case that SCSI_RESET is set, ensure that xs->stimeout is
valid and don't call ahd_setup_data() after ahd_execute_scb() may have freed the scb.
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index c89ea082ea0..aebe2aa8d25 100644
--- a/sys/dev/ic/aic79xx_openbsd.c
+++ b/sys/dev/ic/aic79xx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.c,v 1.15 2004/12/20 20:56:32 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.16 2004/12/20 22:07:25 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -384,6 +384,7 @@ ahd_action(struct scsi_xfer *xs)
SC_DEBUG(xs->sc_link, SDEV_DB3, ("start scb(%p)\n", scb));
scb->xs = xs;
+ timeout_set(&xs->stimeout, ahd_timeout, scb);
/*
* Put all the arguments for the xfer in the scb
@@ -396,17 +397,11 @@ ahd_action(struct scsi_xfer *xs)
scb->flags |= SCB_DEVICE_RESET;
hscb->control |= MK_MESSAGE;
hscb->task_management = SIU_TASKMGMT_LUN_RESET;
- ahd_execute_scb(scb, NULL, 0);
+ return (ahd_execute_scb(scb, NULL, 0));
} else {
hscb->task_management = 0;
+ return (ahd_setup_data(ahd, xs, scb));
}
-#if 0
- if (ccb->ccb_h.flags & CAM_TAG_ACTION_VALID)
- hscb->control |= ccb->csio.tag_action;
-#endif
- timeout_set(&xs->stimeout, ahd_timeout, scb);
-
- return ahd_setup_data(ahd, xs, scb);
}
int