summaryrefslogtreecommitdiff
path: root/sys/dev/usb/umsm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/umsm.c')
-rw-r--r--sys/dev/usb/umsm.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c
index 924d1148600..993380be8a7 100644
--- a/sys/dev/usb/umsm.c
+++ b/sys/dev/usb/umsm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umsm.c,v 1.28 2008/05/28 13:33:44 pyr Exp $ */
+/* $OpenBSD: umsm.c,v 1.29 2008/06/02 09:42:22 yuo Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -256,6 +256,14 @@ umsm_detach(struct device *self, int flags)
struct umsm_softc *sc = (struct umsm_softc *)self;
int rv = 0;
+ /* close the interrupt endpoint if that is opened */
+ if (sc->sc_intr_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_intr_pipe);
+ usbd_close_pipe(sc->sc_intr_pipe);
+ free(sc->sc_intr_buf, M_USBDEV);
+ sc->sc_intr_pipe = NULL;
+ }
+
sc->sc_dying = 1;
if (sc->sc_subdev != NULL) {
rv = config_detach(sc->sc_subdev, flags);