]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/xfrm/xfrm_output.c
Merge tag 'riscv-for-linus-5.6-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / net / xfrm / xfrm_output.c
index b1db55b50ba1644468718b07860cb114302c49dc..fafc7aba705f8add25689b30fcc537ae20a3a2f8 100644 (file)
@@ -533,7 +533,7 @@ static int xfrm_output2(struct net *net, struct sock *sk, struct sk_buff *skb)
 
 static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
-       struct sk_buff *segs;
+       struct sk_buff *segs, *nskb;
 
        BUILD_BUG_ON(sizeof(*IPCB(skb)) > SKB_SGO_CB_OFFSET);
        BUILD_BUG_ON(sizeof(*IP6CB(skb)) > SKB_SGO_CB_OFFSET);
@@ -544,8 +544,7 @@ static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb
        if (segs == NULL)
                return -EINVAL;
 
-       do {
-               struct sk_buff *nskb = segs->next;
+       skb_list_walk_safe(segs, segs, nskb) {
                int err;
 
                skb_mark_not_on_list(segs);
@@ -555,9 +554,7 @@ static int xfrm_output_gso(struct net *net, struct sock *sk, struct sk_buff *skb
                        kfree_skb_list(nskb);
                        return err;
                }
-
-               segs = nskb;
-       } while (segs);
+       }
 
        return 0;
 }