Skip to contentSkip to conversation

ath9k: fix an RCU issue in calling ieee80211_get_tx_rates

PATCH New Felix Fietkau 1 participant 1 message Jun 22, 2013 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: fix an RCU issue in calling ieee80211_get_tx_rates

ath_txq_schedule is called outside of the drv_tx call, so it needs RCU protection.

---
 drivers/net/wireless/ath/ath9k/xmit.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/xmit.c +5 -1
index bfb58a5..c59ae43 100644
@@ -1673,6 +1673,8 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
 	    txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
 		return;
 
+	rcu_read_lock();
+
 	ac = list_first_entry(&txq->axq_acq, struct ath_atx_ac, list);
 	last_ac = list_entry(txq->axq_acq.prev, struct ath_atx_ac, list);
 
@@ -1711,8 +1713,10 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
 
 		if (ac == last_ac ||
 		    txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
-			return;
+			break;
 	}
+
+	rcu_read_unlock();
 }
 
 /***********/
Signature · 1 line
1.8.0.2