From e557e680881d7ae8ffc29fc201b81fc82a57d1eb Mon Sep 17 00:00:00 2001 From: Weongyo Jeong Date: Wed, 20 May 2009 03:49:16 +0000 Subject: [PATCH] try to unsetup USB xfers before calling ieee80211_ifdetach() to fix a bug referencing a destroyed lock within TX callbacks during device detach. Submitted by: hps (original version) Tested by: Lucius Windschuh --- sys/dev/usb/wlan/if_uath.c | 2 +- sys/dev/usb/wlan/if_upgt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index 98c494355bc..f647daec99f 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -517,12 +517,12 @@ uath_detach(device_t dev) sc->sc_flags |= UATH_FLAG_INVALID; uath_stop(ifp); - ieee80211_ifdetach(ic); callout_drain(&sc->stat_ch); callout_drain(&sc->watchdog_ch); usb2_transfer_unsetup(sc->sc_xfer, UATH_N_XFERS); + ieee80211_ifdetach(ic); /* free buffers */ UATH_LOCK(sc); diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c index 3bef0b43359..d99c7400863 100644 --- a/sys/dev/usb/wlan/if_upgt.c +++ b/sys/dev/usb/wlan/if_upgt.c @@ -2002,12 +2002,12 @@ upgt_detach(device_t dev) return 0; upgt_stop(sc); - ieee80211_ifdetach(ic); callout_drain(&sc->sc_led_ch); callout_drain(&sc->sc_watchdog_ch); usb2_transfer_unsetup(sc->sc_xfer, UPGT_N_XFERS); + ieee80211_ifdetach(ic); upgt_free_rx(sc); upgt_free_tx(sc);