From 093d7be50e373b15570b7c3ca61d7bb7680785de Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Wed, 9 Jul 2008 00:10:55 +0000 Subject: [PATCH] Fix a mutex LOR introduced by the conversion of if_ndis from spinlocks to mutexes and replacing the obsolete if_watchdog interface. The ndis_ticktask function calls into ieee80211_new_state under one condition with NDIS_LOCK held. The ieee80211_new_state would call into ndis_start in some cases too, resulting in the occasional case where ndis_start acquires NDIS_LOCK from inside the NDIS_LOCK held by ndis_ticktask. Obtained from: Paul B. Mahol MFC after: 1 week --- sys/dev/if_ndis/if_ndis.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 30600f484def..4981a2e0d93a 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -1717,8 +1717,10 @@ ndis_ticktask(d, xsc) if (sc->ndis_link == 1 && sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) { sc->ndis_link = 0; + NDIS_UNLOCK(sc); if (sc->ndis_80211) ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); + NDIS_LOCK(sc); if_link_state_change(sc->ifp, LINK_STATE_DOWN); }