summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-01-22 00:59:52 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-01-22 00:59:52 +0000
commit4f6fd60891a30cb8a33a21b69175af28c379dd56 (patch)
tree1108d881de66b19a5ab32839c3ea3fc855e3e639
parent7bb7917675e532251d1bc60801695700b8c04499 (diff)
downloadFreeBSD-src-4f6fd60891a30cb8a33a21b69175af28c379dd56.zip
FreeBSD-src-4f6fd60891a30cb8a33a21b69175af28c379dd56.tar.gz
Fixed disconnect for umouse
-rw-r--r--sys/dev/usb/ums.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index cc969e4..5e61216 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -377,8 +377,10 @@ ums_detach(device_t self)
struct ums_softc *sc = device_get_softc(self);
char *devinfo = (char *) device_get_desc(self);
- usbd_abort_pipe(sc->sc_intrpipe);
- usbd_close_pipe(sc->sc_intrpipe);
+ if (sc->sc_enabled) {
+ usbd_abort_pipe(sc->sc_intrpipe);
+ usbd_close_pipe(sc->sc_intrpipe);
+ }
sc->sc_disconnected = 1;
DPRINTF(("%s: disconnected\n", USBDEVNAME(self)));
@@ -638,6 +640,9 @@ ums_read(dev_t dev, struct uio *uio, int flag)
if (error) {
splx(s);
return error;
+ } else if (!sc->sc_enabled) {
+ splx(s);
+ return EINTR;
}
}
OpenPOWER on IntegriCloud