Skip to contentSkip to conversation

mac80211: fix dialog token allocator

PATCH New Johannes Berg 1 participant 1 message May 31, 2010 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: fix dialog token allocator

From: Johannes Berg <[email protected]>

The dialog token allocator has apparently been broken since b83f4e15 ("mac80211: fix deadlock in sta->lock") because it got moved out under the spinlock. Fix it.

---
Seems like a low-impact change ... could be backported to almost every stable tree out there I guess since it was broken almost exactly three years ago ... but does it matter? I guess not.

 net/mac80211/agg-tx.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/mac80211/agg-tx.c +4 -2
@@ -332,14 +332,16 @@ int ieee80211_start_tx_ba_session(struct
 		IEEE80211_QUEUE_STOP_REASON_AGGREGATION);
 
 	spin_unlock(&local->ampdu_lock);
-	spin_unlock_bh(&sta->lock);
 
-	/* send an addBA request */
+	/* prepare tid data */
 	sta->ampdu_mlme.dialog_token_allocator++;
 	sta->ampdu_mlme.tid_tx[tid]->dialog_token =
 			sta->ampdu_mlme.dialog_token_allocator;
 	sta->ampdu_mlme.tid_tx[tid]->ssn = start_seq_num;
 
+	spin_unlock_bh(&sta->lock);
+
+	/* send AddBA request */
 	ieee80211_send_addba_request(sdata, pubsta->addr, tid,
 			 sta->ampdu_mlme.tid_tx[tid]->dialog_token,
 			 sta->ampdu_mlme.tid_tx[tid]->ssn,