summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-20 03:37:06 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-20 03:37:06 +0000
commit079ef7a62f40903d641ad54285c6354970160e5c (patch)
tree6008632e9c14003b2eed3bc6becd036984d80dc1
parentf617e7a213a9c63399fea1fa852ebfc2fa26fcec (diff)
DO NOT access xs after calling scsi_done(xs). It's not there anymore.
'totally OK' deraadt@
-rw-r--r--sys/dev/usb/umass_scsi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c
index a79e55f7fd6..56c781b3b0a 100644
--- a/sys/dev/usb/umass_scsi.c
+++ b/sys/dev/usb/umass_scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umass_scsi.c,v 1.19 2007/10/09 23:03:30 krw Exp $ */
+/* $OpenBSD: umass_scsi.c,v 1.20 2007/10/20 03:37:05 krw Exp $ */
/* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -180,7 +180,7 @@ umass_scsi_cmd(struct scsi_xfer *xs)
struct umass_softc *sc = sc_link->adapter_softc;
struct scsi_generic *cmd;
- int cmdlen, dir, s;
+ int cmdlen, dir, rslt, s;
#ifdef UMASS_DEBUG
microtime(&sc->tv);
@@ -277,14 +277,16 @@ umass_scsi_cmd(struct scsi_xfer *xs)
/* Return if command finishes early. */
done:
xs->flags |= ITSDONE;
+ if (xs->flags & SCSI_POLL)
+ rslt = COMPLETE;
+ else
+ rslt = SUCCESSFULLY_QUEUED;
s = splbio();
scsi_done(xs);
splx(s);
- if (xs->flags & SCSI_POLL)
- return (COMPLETE);
- else
- return (SUCCESSFULLY_QUEUED);
+
+ return (rslt);
}
void