summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2013-07-05 07:56:37 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2013-07-05 07:56:37 +0000
commitfbbb481ae71d5147d5bcebca53f05adc34c4f619 (patch)
tree7e3887b0c760f7e7f2e645c15204025a13e08217
parent9d0828b86504405f58688b455c9a3d085b5f5626 (diff)
Correctly abort and free the pipe when detaching the device. Found the
hard way by otto@
-rw-r--r--sys/dev/usb/umodem.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c
index bd0127f130a..d55b4a282f0 100644
--- a/sys/dev/usb/umodem.c
+++ b/sys/dev/usb/umodem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: umodem.c,v 1.49 2013/04/26 13:46:40 mglocker Exp $ */
+/* $OpenBSD: umodem.c,v 1.50 2013/07/05 07:56:36 mpi Exp $ */
/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
/*
@@ -766,6 +766,12 @@ umodem_detach(struct device *self, int flags)
DPRINTF(("umodem_detach: sc=%p flags=%d\n", sc, flags));
+ if (sc->sc_notify_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_notify_pipe);
+ usbd_close_pipe(sc->sc_notify_pipe);
+ sc->sc_notify_pipe = NULL;
+ }
+
if (sc->sc_subdev != NULL)
rv = config_detach(sc->sc_subdev, flags);