diff options
author | 2007-10-20 03:37:05 +0000 | |
---|---|---|
committer | 2007-10-20 03:37:05 +0000 | |
commit | 2af14c2d30ee5ec6192e9dad916b084279c10b6e (patch) | |
tree | 6a24fd9e3d0b5517c5342e6e4da014b7547a2a76 | |
parent | replace auich's DMA and interrupt handling with code from NetBSD's (diff) | |
download | wireguard-openbsd-2af14c2d30ee5ec6192e9dad916b084279c10b6e.tar.xz wireguard-openbsd-2af14c2d30ee5ec6192e9dad916b084279c10b6e.zip |
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.c | 14 |
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 |