]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: openvswitch: use skb_list_walk_safe helper for gso segments
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 13 Jan 2020 23:42:29 +0000 (18:42 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Jan 2020 19:48:41 +0000 (11:48 -0800)
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>
net/openvswitch/datapath.c

index e3a37d22539c061ef946e648a44911a5edf4d42d..659c2a790fe7cf919d3b5b6af3bd41ffde1211c7 100644 (file)
@@ -321,8 +321,7 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
        }
 
        /* Queue all of the segments. */
-       skb = segs;
-       do {
+       skb_list_walk_safe(segs, skb, nskb) {
                if (gso_type & SKB_GSO_UDP && skb != segs)
                        key = &later_key;
 
@@ -330,17 +329,15 @@ static int queue_gso_packets(struct datapath *dp, struct sk_buff *skb,
                if (err)
                        break;
 
-       } while ((skb = skb->next));
+       }
 
        /* Free all of the segments. */
-       skb = segs;
-       do {
-               nskb = skb->next;
+       skb_list_walk_safe(segs, skb, nskb) {
                if (err)
                        kfree_skb(skb);
                else
                        consume_skb(skb);
-       } while ((skb = nskb));
+       }
        return err;
 }