]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: r8152: use skb_list_walk_safe helper for gso segments
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 8 Jan 2020 21:59:04 +0000 (16:59 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Jan 2020 23:19:55 +0000 (15:19 -0800)
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: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/r8152.c

index 9ec1da429514c306a05a72f623b46f11308c5597..fe22a582373b8e10090b546c1e0bad226202a794 100644 (file)
@@ -1897,8 +1897,8 @@ static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb,
 {
        if (skb_shinfo(skb)->gso_size) {
                netdev_features_t features = tp->netdev->features;
+               struct sk_buff *segs, *seg, *next;
                struct sk_buff_head seg_list;
-               struct sk_buff *segs, *nskb;
 
                features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
                segs = skb_gso_segment(skb, features);
@@ -1907,12 +1907,10 @@ static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb,
 
                __skb_queue_head_init(&seg_list);
 
-               do {
-                       nskb = segs;
-                       segs = segs->next;
-                       nskb->next = NULL;
-                       __skb_queue_tail(&seg_list, nskb);
-               } while (segs);
+               skb_list_walk_safe(segs, seg, next) {
+                       skb_mark_not_on_list(seg);
+                       __skb_queue_tail(&seg_list, seg);
+               }
 
                skb_queue_splice(&seg_list, list);
                dev_kfree_skb(skb);