summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authoremax <emax@FreeBSD.org>2008-10-03 22:40:42 +0000
committeremax <emax@FreeBSD.org>2008-10-03 22:40:42 +0000
commitc790c4de6495137d1e6a38e27265ad34aeb5d0a8 (patch)
treeaf6b4cd9fa74f951176e6c907ec26bb4679f44ef /sys/netgraph
parentc07f87c6a9cb1a1e2c8874134cb0d25aa69ceb4e (diff)
downloadFreeBSD-src-c790c4de6495137d1e6a38e27265ad34aeb5d0a8.zip
FreeBSD-src-c790c4de6495137d1e6a38e27265ad34aeb5d0a8.tar.gz
Abort transfers on all pipes before closing them. This fixes the crash
when Bluetooth USB device is pulled out without stopping the stack first. Submitted by: Vladimir Grebenschikov vova at fbsd dot ru MFC after: 1 week
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
index 1ecbe93..5d2b4a2 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
@@ -812,24 +812,29 @@ ubt_detach(device_t self)
/* Close pipes */
if (sc->sc_intr_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_intr_pipe);
usbd_close_pipe(sc->sc_intr_pipe);
sc->sc_intr_pipe = NULL;
}
if (sc->sc_bulk_in_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_bulk_in_pipe);
usbd_close_pipe(sc->sc_bulk_in_pipe);
sc->sc_bulk_in_pipe = NULL;
}
if (sc->sc_bulk_out_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_bulk_out_pipe);
usbd_close_pipe(sc->sc_bulk_out_pipe);
sc->sc_bulk_out_pipe = NULL;
}
if (sc->sc_isoc_in_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_isoc_in_pipe);
usbd_close_pipe(sc->sc_isoc_in_pipe);
sc->sc_isoc_in_pipe = NULL;
}
if (sc->sc_isoc_out_pipe != NULL) {
+ usbd_abort_pipe(sc->sc_isoc_out_pipe);
usbd_close_pipe(sc->sc_isoc_out_pipe);
sc->sc_isoc_out_pipe = NULL;
}
OpenPOWER on IntegriCloud