From ab521a755ebde580015c10a7756e85ee4d3738c5 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Fri, 22 Jan 1999 00:59:52 +0000 Subject: [PATCH] Fixed disconnect for umouse --- sys/dev/usb/ums.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index cc969e43401..5e61216971b 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; } }