Commit 5643a552 authored by Jason A. Donenfeld's avatar Jason A. Donenfeld Committed by David S. Miller

net: tap: use skb_list_walk_safe helper for gso segments

This is a straight-forward conversion case for the new function, and
while we're at it, we can remove a null write to skb->next by replacing
it with skb_mark_not_on_list.
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dcfea72e
...@@ -341,6 +341,7 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb) ...@@ -341,6 +341,7 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb)
features |= tap->tap_features; features |= tap->tap_features;
if (netif_needs_gso(skb, features)) { if (netif_needs_gso(skb, features)) {
struct sk_buff *segs = __skb_gso_segment(skb, features, false); struct sk_buff *segs = __skb_gso_segment(skb, features, false);
struct sk_buff *next;
if (IS_ERR(segs)) if (IS_ERR(segs))
goto drop; goto drop;
...@@ -352,16 +353,13 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb) ...@@ -352,16 +353,13 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb)
} }
consume_skb(skb); consume_skb(skb);
while (segs) { skb_list_walk_safe(segs, skb, next) {
struct sk_buff *nskb = segs->next; skb_mark_not_on_list(skb);
if (ptr_ring_produce(&q->ring, skb)) {
segs->next = NULL; kfree_skb(skb);
if (ptr_ring_produce(&q->ring, segs)) { kfree_skb_list(next);
kfree_skb(segs);
kfree_skb_list(nskb);
break; break;
} }
segs = nskb;
} }
} else { } else {
/* If we receive a partial checksum and the tap side /* If we receive a partial checksum and the tap side
......
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