1 --- a/net/mac80211/tx.c
2 +++ b/net/mac80211/tx.c
3 @@ -354,7 +354,7 @@ static void purge_old_ps_buffers(struct
4 total += skb_queue_len(&sta->ps_tx_buf[ac]);
8 + ieee80211_free_txskb(&local->hw, skb);
12 @@ -466,7 +466,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee
14 "STA %pM TX buffer for AC %d full - dropping oldest frame\n",
17 + ieee80211_free_txskb(&local->hw, old);
19 tx->local->total_ps_buffered++;
21 @@ -1103,7 +1103,7 @@ static bool ieee80211_tx_prep_agg(struct
22 spin_unlock(&tx->sta->lock);
25 - dev_kfree_skb(purge_skb);
26 + ieee80211_free_txskb(&tx->local->hw, purge_skb);
29 /* reset session timer */
30 @@ -1214,7 +1214,7 @@ static bool ieee80211_tx_frags(struct ie
31 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
32 if (WARN_ON_ONCE(q >= local->hw.queues)) {
33 __skb_unlink(skb, skbs);
35 + ieee80211_free_txskb(&local->hw, skb);
39 @@ -1356,7 +1356,7 @@ static int invoke_tx_handlers(struct iee
40 if (unlikely(res == TX_DROP)) {
41 I802_DEBUG_INC(tx->local->tx_handlers_drop);
43 - dev_kfree_skb(tx->skb);
44 + ieee80211_free_txskb(&tx->local->hw, tx->skb);
46 __skb_queue_purge(&tx->skbs);
48 @@ -1393,7 +1393,7 @@ static bool ieee80211_tx(struct ieee8021
49 res_prepare = ieee80211_tx_prepare(sdata, &tx, skb);
51 if (unlikely(res_prepare == TX_DROP)) {
53 + ieee80211_free_txskb(&local->hw, skb);
55 } else if (unlikely(res_prepare == TX_QUEUED)) {
57 @@ -1465,7 +1465,7 @@ void ieee80211_xmit(struct ieee80211_sub
58 headroom = max_t(int, 0, headroom);
60 if (ieee80211_skb_resize(sdata, skb, headroom, may_encrypt)) {
62 + ieee80211_free_txskb(&local->hw, skb);
66 @@ -2056,8 +2056,10 @@ netdev_tx_t ieee80211_subif_start_xmit(s
67 head_need += IEEE80211_ENCRYPT_HEADROOM;
68 head_need += local->tx_headroom;
69 head_need = max_t(int, 0, head_need);
70 - if (ieee80211_skb_resize(sdata, skb, head_need, true))
72 + if (ieee80211_skb_resize(sdata, skb, head_need, true)) {
73 + ieee80211_free_txskb(&local->hw, skb);
74 + return NETDEV_TX_OK;
79 @@ -2190,7 +2192,7 @@ void ieee80211_tx_pending(unsigned long
80 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
82 if (WARN_ON(!info->control.vif)) {
84 + ieee80211_free_txskb(&local->hw, skb);
88 --- a/net/mac80211/status.c
89 +++ b/net/mac80211/status.c
90 @@ -34,7 +34,7 @@ void ieee80211_tx_status_irqsafe(struct
91 skb_queue_len(&local->skb_queue_unreliable);
92 while (tmp > IEEE80211_IRQSAFE_QUEUE_LIMIT &&
93 (skb = skb_dequeue(&local->skb_queue_unreliable))) {
94 - dev_kfree_skb_irq(skb);
95 + ieee80211_free_txskb(hw, skb);
97 I802_DEBUG_INC(local->tx_status_drop);
99 @@ -159,7 +159,7 @@ static void ieee80211_handle_filtered_fr
100 "dropped TX filtered frame, queue_len=%d PS=%d @%lu\n",
101 skb_queue_len(&sta->tx_filtered[ac]),
102 !!test_sta_flag(sta, WLAN_STA_PS_STA), jiffies);
103 - dev_kfree_skb(skb);
104 + ieee80211_free_txskb(&local->hw, skb);
107 static void ieee80211_check_pending_bar(struct sta_info *sta, u8 *addr, u8 tid)