diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/uow.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c index 9b3fce3df0c..e18f53b8d70 100644 --- a/sys/dev/usb/uow.c +++ b/sys/dev/usb/uow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uow.c,v 1.2 2006/09/27 13:02:47 grange Exp $ */ +/* $OpenBSD: uow.c,v 1.3 2006/09/27 14:40:55 grange Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org> @@ -191,18 +191,28 @@ fail: USB_DETACH(uow) { USB_DETACH_START(uow, sc); - int rv = 0; + int rv = 0, s; - if (sc->sc_ph_ibulk != NULL) + s = splusb(); + + if (sc->sc_ph_ibulk != NULL) { + usbd_abort_pipe(sc->sc_ph_ibulk); usbd_close_pipe(sc->sc_ph_ibulk); - if (sc->sc_ph_obulk != NULL) + } + if (sc->sc_ph_obulk != NULL) { + usbd_abort_pipe(sc->sc_ph_obulk); usbd_close_pipe(sc->sc_ph_obulk); - if (sc->sc_ph_intr != NULL) + } + if (sc->sc_ph_intr != NULL) { + usbd_abort_pipe(sc->sc_ph_intr); usbd_close_pipe(sc->sc_ph_intr); + } if (sc->sc_ow_dev != NULL) rv = config_detach(sc->sc_ow_dev, flags); + splx(s); + usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, USBDEV(sc->sc_dev)); |