From ae0893a33963c3f89e4889ba46af05bc0d7c001b Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Fri, 18 Mar 2005 13:53:32 +0000 Subject: 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. --- sys/dev/usb/if_ral.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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 -- cgit v1.2.3