mac80211: only single mutex locked to prevent deadlock
PATCH 1/1 mac80211: only single mutex locked to prevent deadlock
From: Wey-Yi Guy <[email protected]>
Both ifmgd->mtx and sdata->local->iflist_mtx are locked in ieee80211_mgd_probe_ap(), not sure it will cause deadlock condition. but it is better to only has one mutex at a time.
Signed-off-by Wey-Yi Guy <[email protected]>
--- net/mac80211/mlme.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
net/mac80211/mlme.c +3 -0
@@ -914,10 +914,13 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,if (already) goto out; +mutex_unlock (&ifmgd->mtx); +mutex_lock (&sdata->local->iflist_mtx);ieee80211_recalc_ps (sdata->local,-1 );mutex_unlock (&sdata->local->iflist_mtx); +mutex_lock (&ifmgd->mtx); ifmgd->probe_send_count =0 ;ieee80211_mgd_probe_ap_send (sdata); out:
Signature · 1 line
1.5.6.3
Johannes Berg
maintainerQuoted 5 lines · On Mon, 2010-01-25 at 10:12 -0800, [email protected] wrote:
From: Wey-Yi Guy <[email protected]>
Both
ifmgd->mtxandsdata->local->iflist_mtxare locked inieee80211_mgd_probe_ap(), not sure it will cause deadlock condition. but it is better to only has one mutex at a time.
It shouldn't cause a deadlock, we do this all the time, e.g. in ieee80211_rx_mgmt_probe_resp(), so I don't think the extra locking makes a lot of sense.
johannes