From 854cb5a41aac2f8f140c8510fabf95c916e075b0 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 29 Apr 2003 03:22:39 +0000 Subject: [PATCH] Don't hold a driver lock across bus_teardown_intr. Jhb points out that one cannot generally hold a lock and call bus_teardown_intr. This is race free with wi_intr because bus_teardown_intr won't allow wi_intr to be called after it returns. # jeff hsu points out that there might be a race between this unlock # and wi_start. While that may be true also, it won't impact this commit. Submitted by: jhb --- sys/dev/wi/if_wi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 62e8bbc1f0ef..cc53a0d4104c 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -486,10 +486,9 @@ wi_detach(device_t dev) ifmedia_removeall(&sc->sc_media); ieee80211_ifdetach(ifp); + WI_UNLOCK(sc); bus_teardown_intr(dev, sc->irq, sc->wi_intrhand); wi_free(dev); - - WI_UNLOCK(sc); #if __FreeBSD_version >= 500000 mtx_destroy(&sc->sc_mtx); #endif