mac80211: Simplify locking in ieee80211_sta_tear_down_BA_sessions()
authorIlan peer <ilan.peer@intel.com>
Wed, 6 Sep 2017 14:18:33 +0000 (17:18 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 21 Sep 2017 09:42:01 +0000 (11:42 +0200)
Simplify the locking in  ieee80211_sta_tear_down_BA_sessions() and
lock sta->ampdu_mlme.mtx over the entire function instead of
locking/unlocking it for each TID etc.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ht.c

index d6d0b4201e40bf2eadc2ac7051192c7ca5551439..41f5e48f802197218e79c976ea8f99d967cff91f 100644 (file)
@@ -290,13 +290,15 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta,
 {
        int i;
 
+       mutex_lock(&sta->ampdu_mlme.mtx);
        for (i = 0; i <  IEEE80211_NUM_TIDS; i++) {
-               __ieee80211_stop_tx_ba_session(sta, i, reason);
-               __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT,
-                                              WLAN_REASON_QSTA_LEAVE_QBSS,
-                                              reason != AGG_STOP_DESTROY_STA &&
-                                              reason != AGG_STOP_PEER_REQUEST);
+               ___ieee80211_stop_tx_ba_session(sta, i, reason);
+               ___ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT,
+                                               WLAN_REASON_QSTA_LEAVE_QBSS,
+                                               reason != AGG_STOP_DESTROY_STA &&
+                                               reason != AGG_STOP_PEER_REQUEST);
        }
+       mutex_unlock(&sta->ampdu_mlme.mtx);
 
        /* stopping might queue the work again - so cancel only afterwards */
        cancel_work_sync(&sta->ampdu_mlme.work);