]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mt76: mt7615: use ieee80211_free_txskb() in mt7615_tx_token_put()
authorRyder Lee <ryder.lee@mediatek.com>
Tue, 13 Apr 2021 08:00:07 +0000 (16:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:26 +0000 (10:49 +0200)
commit 06991d1f73a9bdbc5f234ee96737b9102705b89c upstream.

We should use ieee80211_free_txskb() to report skb status avoid wrong
aql accounting after reset.

Cc: stable@vger.kernel.org
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c

index fb10a6497ed056723d9806c99b1772e5bcf983cf..cb8bf6a29b52a826fa8e8c52eda6fe53dadaa302 100644 (file)
@@ -2066,8 +2066,12 @@ void mt7615_tx_token_put(struct mt7615_dev *dev)
        spin_lock_bh(&dev->token_lock);
        idr_for_each_entry(&dev->token, txwi, id) {
                mt7615_txp_skb_unmap(&dev->mt76, txwi);
-               if (txwi->skb)
-                       dev_kfree_skb_any(txwi->skb);
+               if (txwi->skb) {
+                       struct ieee80211_hw *hw;
+
+                       hw = mt76_tx_status_get_hw(&dev->mt76, txwi->skb);
+                       ieee80211_free_txskb(hw, txwi->skb);
+               }
                mt76_put_txwi(&dev->mt76, txwi);
        }
        spin_unlock_bh(&dev->token_lock);