ath9k_htc: Add a sanity check in ath9k_htc_ampdu_action()
[pandora-kernel.git] / drivers / net / wireless / ath / ath9k / htc_drv_main.c
index b6cd36c..f051e0c 100644 (file)
@@ -1640,6 +1640,10 @@ static int ath9k_htc_ampdu_action(struct ieee80211_hw *hw,
                ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
                break;
        case IEEE80211_AMPDU_TX_OPERATIONAL:
+               if (tid >= ATH9K_HTC_MAX_TID) {
+                       ret = -EINVAL;
+                       break;
+               }
                ista = (struct ath9k_htc_sta *) sta->drv_priv;
                spin_lock_bh(&priv->tx.tx_lock);
                ista->tid_state[tid] = AGGR_OPERATIONAL;