diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2004-07-21 07:55:52 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2004-07-21 07:55:52 +0000 |
commit | 95baeb009f3620d06626dea439ae2ffcfc7ecd05 (patch) | |
tree | e2d5479c9fb2c2ecac1e887229bf601615c7cca3 /sys/dev/usb | |
parent | f5b6f8d766a37c21c3ebee8a232aa2633bdeb108 (diff) |
from netbsd, umass.c 1.105
do less work if we hit an error
ok krw@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/umass.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 88c880247f7..c08360a6fc8 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.33 2004/07/21 07:51:04 dlg Exp $ */ +/* $OpenBSD: umass.c,v 1.34 2004/07/21 07:55:51 dlg Exp $ */ /* $NetBSD: umass.c,v 1.98 2003/09/08 19:30:59 mycroft Exp $ */ /*- * Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>, @@ -608,15 +608,17 @@ USB_ATTACH(umass) USB_DETACH(umass) { USB_DETACH_START(umass, sc); - struct umassbus_softc *scbus = sc->bus; + struct umassbus_softc *scbus; int rv = 0, i, s; DPRINTF(UDMASS_USB, ("%s: detached\n", USBDEVNAME(sc->sc_dev))); /* Abort the pipes to wake up any waiting processes. */ for (i = 0 ; i < UMASS_NEP ; i++) { - if (sc->sc_pipe[i] != NULL) + if (sc->sc_pipe[i] != NULL) { usbd_abort_pipe(sc->sc_pipe[i]); + sc->sc_pipe[i] = NULL; + } } /* Do we really need reference counting? Perhaps in ioctl() */ @@ -630,6 +632,7 @@ USB_DETACH(umass) } splx(s); + scbus = sc->bus; if (scbus != NULL) { if (scbus->sc_child != NULL) rv = config_detach(scbus->sc_child, flags); |