summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2006-03-04 14:20:37 +0000
committerkrw <krw@openbsd.org>2006-03-04 14:20:37 +0000
commit5d417fe588b9ce8aade7d25cd4e24b21d8abc72a (patch)
treeec562ecb516b1aa3d91ebc33c3ae515a780d19dd
parentcut down the Locator code into maintainable chunks. (diff)
downloadwireguard-openbsd-5d417fe588b9ce8aade7d25cd4e24b21d8abc72a.tar.xz
wireguard-openbsd-5d417fe588b9ce8aade7d25cd4e24b21d8abc72a.zip
All CAM_* values stored in xs->error must be 'interpreted' by
ah[cd]_done() into XS_* values understood by the SCSI code before returning xs to the tender mercies of the SCSI code. So if we bail out without calling ah[cd]_done(), because the request cdb length is excessive, don't use ah[cd]_set_transaction() to put CAM_REQ_INVALID into xs->error, just jam in XS_DRIVER_STUFFUP as ah[cd]_done() would have. If CAM_REQ_INVALID escapes it will be interpreted as XS_SHORT_SENSE as far as I can tell. This code path should never be trod so the net effect should be minimal.
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c4
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index d973286d26b..c32948cd517 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.23 2005/12/28 02:43:54 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.24 2006/03/04 14:20:37 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -545,10 +545,10 @@ ahd_setup_data(struct ahd_softc *ahd, struct scsi_xfer *xs,
hscb->cdb_len = xs->cmdlen;
if (hscb->cdb_len > MAX_CDB_LEN) {
- aic_set_transaction_status(scb, CAM_REQ_INVALID);
ahd_lock(ahd, &s);
ahd_free_scb(ahd, scb);
ahd_unlock(ahd, &s);
+ xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
return (COMPLETE);
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index 9933f9ecfbe..8969172287c 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.31 2005/12/28 03:00:07 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.32 2006/03/04 14:20:37 krw Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -572,10 +572,10 @@ ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
hscb->cdb_len = xs->cmdlen;
if (hscb->cdb_len > sizeof(hscb->cdb32)) {
- ahc_set_transaction_status(scb, CAM_REQ_INVALID);
ahc_lock(ahc, &s);
ahc_free_scb(ahc, scb);
ahc_unlock(ahc, &s);
+ xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
return (COMPLETE);