package/mac80211/patches/560-ath9k_buffer_leak.patch |
| 1 | --- a/drivers/net/wireless/ath/ath9k/xmit.c |
| 2 | @@ -2430,37 +2430,37 @@ void ath_tx_node_init(struct ath_softc * |
| 3 | |
| 4 | void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) |
| 5 | { |
| 6 | - int i; |
| 7 | - struct ath_atx_ac *ac, *ac_tmp; |
| 8 | - struct ath_atx_tid *tid, *tid_tmp; |
| 9 | + struct ath_atx_ac *ac; |
| 10 | + struct ath_atx_tid *tid; |
| 11 | struct ath_txq *txq; |
| 12 | + int i, tidno; |
| 13 | |
| 14 | - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { |
| 15 | - if (ATH_TXQ_SETUP(sc, i)) { |
| 16 | - txq = &sc->tx.txq[i]; |
| 17 | - |
| 18 | - spin_lock_bh(&txq->axq_lock); |
| 19 | - |
| 20 | - list_for_each_entry_safe(ac, |
| 21 | - ac_tmp, &txq->axq_acq, list) { |
| 22 | - tid = list_first_entry(&ac->tid_q, |
| 23 | - struct ath_atx_tid, list); |
| 24 | - if (tid && tid->an != an) |
| 25 | - continue; |
| 26 | - list_del(&ac->list); |
| 27 | - ac->sched = false; |
| 28 | - |
| 29 | - list_for_each_entry_safe(tid, |
| 30 | - tid_tmp, &ac->tid_q, list) { |
| 31 | - list_del(&tid->list); |
| 32 | - tid->sched = false; |
| 33 | - ath_tid_drain(sc, txq, tid); |
| 34 | - tid->state &= ~AGGR_ADDBA_COMPLETE; |
| 35 | - tid->state &= ~AGGR_CLEANUP; |
| 36 | - } |
| 37 | - } |
| 38 | + for (tidno = 0, tid = &an->tid[tidno]; |
| 39 | + tidno < WME_NUM_TID; tidno++, tid++) { |
| 40 | + i = tid->ac->qnum; |
| 41 | |
| 42 | - spin_unlock_bh(&txq->axq_lock); |
| 43 | + if (!ATH_TXQ_SETUP(sc, i)) |
| 44 | + continue; |
| 45 | + |
| 46 | + txq = &sc->tx.txq[i]; |
| 47 | + ac = tid->ac; |
| 48 | + |
| 49 | + spin_lock_bh(&txq->axq_lock); |
| 50 | + |
| 51 | + if (tid->sched) { |
| 52 | + list_del(&tid->list); |
| 53 | + tid->sched = false; |
| 54 | } |
| 55 | + |
| 56 | + if (ac->sched) { |
| 57 | + list_del(&ac->list); |
| 58 | + tid->ac->sched = false; |
| 59 | + } |
| 60 | + |
| 61 | + ath_tid_drain(sc, txq, tid); |
| 62 | + tid->state &= ~AGGR_ADDBA_COMPLETE; |
| 63 | + tid->state &= ~AGGR_CLEANUP; |
| 64 | + |
| 65 | + spin_unlock_bh(&txq->axq_lock); |
| 66 | } |
| 67 | } |