diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2005-03-18 13:53:32 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2005-03-18 13:53:32 +0000 |
commit | ae0893a33963c3f89e4889ba46af05bc0d7c001b (patch) | |
tree | 193288e1a0a6b5b4fb40f9c848b4a7a28359e785 /sys | |
parent | 6b2863a63d185748abfe77ee1a470e752b702dac (diff) |
close pipes and free tx/rx lists in detach(). this avoids some of the
panics observed when detaching the device while the interface is up.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/if_ral.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index ae7d2f4a07e..52cfffbc901 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.6 2005/03/17 14:23:03 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.7 2005/03/18 13:53:31 damien Exp $ */ /*- * Copyright (c) 2005 @@ -479,6 +479,19 @@ USB_DETACH(ural) usb_rem_task(sc->sc_udev, &sc->sc_task); timeout_del(&sc->scan_ch); + if (sc->sc_rx_pipeh != NULL) { + usbd_abort_pipe(sc->sc_rx_pipeh); + usbd_close_pipe(sc->sc_rx_pipeh); + } + + if (sc->sc_tx_pipeh != NULL) { + usbd_abort_pipe(sc->sc_tx_pipeh); + usbd_close_pipe(sc->sc_tx_pipeh); + } + + ural_free_rx_list(sc); + ural_free_tx_list(sc); + #if NBPFILTER > 0 bpfdetach(ifp); #endif |