Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: use ieee80211_free_txskb in a few more places

Free tx status skbs when draining power save buffers, pending frames, or
when tearing down a vif.
Fixes remaining conditions that can lead to hostapd/wpa_supplicant hangs when
running out of socket write memory.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Felix Fietkau and committed by
John W. Linville
d4fa14cd 3e4f319d

+5 -5
+1 -1
net/mac80211/iface.c
··· 853 853 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 854 854 if (info->control.vif == &sdata->vif) { 855 855 __skb_unlink(skb, &local->pending[i]); 856 - dev_kfree_skb_irq(skb); 856 + ieee80211_free_txskb(&local->hw, skb); 857 857 } 858 858 } 859 859 }
+2 -2
net/mac80211/sta_info.c
··· 650 650 */ 651 651 if (!skb) 652 652 break; 653 - dev_kfree_skb(skb); 653 + ieee80211_free_txskb(&local->hw, skb); 654 654 } 655 655 656 656 /* ··· 679 679 local->total_ps_buffered--; 680 680 ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", 681 681 sta->sta.addr); 682 - dev_kfree_skb(skb); 682 + ieee80211_free_txskb(&local->hw, skb); 683 683 } 684 684 685 685 /*
+2 -2
net/mac80211/util.c
··· 406 406 int queue = info->hw_queue; 407 407 408 408 if (WARN_ON(!info->control.vif)) { 409 - kfree_skb(skb); 409 + ieee80211_free_txskb(&local->hw, skb); 410 410 return; 411 411 } 412 412 ··· 431 431 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 432 432 433 433 if (WARN_ON(!info->control.vif)) { 434 - kfree_skb(skb); 434 + ieee80211_free_txskb(&local->hw, skb); 435 435 continue; 436 436 } 437 437