Skip to content

Commit

Permalink
mac80211: use ieee80211_free_txskb in a few more places
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Oct 15, 2012
1 parent 3e4f319 commit d4fa14c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
if (info->control.vif == &sdata->vif) {
__skb_unlink(skb, &local->pending[i]);
dev_kfree_skb_irq(skb);
ieee80211_free_txskb(&local->hw, skb);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local,
*/
if (!skb)
break;
dev_kfree_skb(skb);
ieee80211_free_txskb(&local->hw, skb);
}

/*
Expand Down Expand Up @@ -679,7 +679,7 @@ static bool sta_info_cleanup_expire_buffered_ac(struct ieee80211_local *local,
local->total_ps_buffered--;
ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n",
sta->sta.addr);
dev_kfree_skb(skb);
ieee80211_free_txskb(&local->hw, skb);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ void ieee80211_add_pending_skb(struct ieee80211_local *local,
int queue = info->hw_queue;

if (WARN_ON(!info->control.vif)) {
kfree_skb(skb);
ieee80211_free_txskb(&local->hw, skb);
return;
}

Expand All @@ -431,7 +431,7 @@ void ieee80211_add_pending_skbs_fn(struct ieee80211_local *local,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);

if (WARN_ON(!info->control.vif)) {
kfree_skb(skb);
ieee80211_free_txskb(&local->hw, skb);
continue;
}

Expand Down

0 comments on commit d4fa14c

Please sign in to comment.