Commit 9f3ef3d7 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by David S. Miller

net: mac80211: use skb_list_walk_safe helper for gso segments

This is a conversion case for the new function, keeping the flow of the
existing code as intact as possible. We also switch over to using
skb_mark_not_on_list instead of a null write to skb->next.

Finally, this code appeared to have a memory leak in the case where
header building fails before the last gso segment. In that case, the
remaining segments are not freed. So this commit also adds the proper
kfree_skb_list call for the remainder of the skbs.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2670ee77
...@@ -3949,18 +3949,15 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -3949,18 +3949,15 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
} }
} }
next = skb; skb_list_walk_safe(skb, skb, next) {
while (next) { skb_mark_not_on_list(skb);
skb = next;
next = skb->next;
skb->prev = NULL;
skb->next = NULL;
skb = ieee80211_build_hdr(sdata, skb, info_flags, skb = ieee80211_build_hdr(sdata, skb, info_flags,
sta, ctrl_flags); sta, ctrl_flags);
if (IS_ERR(skb)) if (IS_ERR(skb)) {
kfree_skb_list(next);
goto out; goto out;
}
ieee80211_tx_stats(dev, skb->len); ieee80211_tx_stats(dev, skb->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment