Skip to content

Commit 2cec444

Browse files
zx2c4davem330
authored andcommitted
net: openvswitch: use skb_list_walk_safe helper for gso segments
This is a straight-forward conversion case for the new function, keeping the flow of the existing code as intact as possible. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c3b18e0 commit 2cec444

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎net/openvswitch/datapath.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,26 +321,23 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
321321
}
322322

323323
/* Queue all of the segments. */
324-
skb = segs;
325-
do {
324+
skb_list_walk_safe(segs, skb, nskb) {
326325
if (gso_type & SKB_GSO_UDP && skb != segs)
327326
key = &later_key;
328327

329328
err = queue_userspace_packet(dp, skb, key, upcall_info, cutlen);
330329
if (err)
331330
break;
332331

333-
} while ((skb = skb->next));
332+
}
334333

335334
/* Free all of the segments. */
336-
skb = segs;
337-
do {
338-
nskb = skb->next;
335+
skb_list_walk_safe(segs, skb, nskb) {
339336
if (err)
340337
kfree_skb(skb);
341338
else
342339
consume_skb(skb);
343-
} while ((skb = nskb));
340+
}
344341
return err;
345342
}
346343

0 commit comments

Comments
 (0)