ath9k: fix an RCU issue in calling ieee80211_get_tx_rates
authorFelix Fietkau <nbd@openwrt.org>
Sat, 22 Jun 2013 10:39:26 +0000 (12:39 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Jun 2013 17:52:52 +0000 (13:52 -0400)
ath_txq_schedule is called outside of the drv_tx call, so it needs RCU
protection.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/xmit.c

index 1c9b1bac8b0d4795b4226f5944764c4dae3bbdba..83ab6be3fe6d502178b3253943bdd0097f4f8cbe 100644 (file)
@@ -1570,6 +1570,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);
 
@@ -1608,8 +1610,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();
 }
 
 /***********/