net: use kfree_skb_list() helper in more places
authorFlorian Westphal <fw@strlen.de>
Tue, 9 Sep 2014 23:08:46 +0000 (01:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Sep 2014 03:10:45 +0000 (20:10 -0700)
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_output.c
net/xfrm/xfrm_output.c

index b7a3e7b3378e470edfc35e8b3235a529c174c3e5..2e6a0dbf7fb3bf95586dcf690f65e0180f721bdd 100644 (file)
@@ -701,11 +701,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
                        return 0;
                }
 
-               while (frag) {
-                       skb = frag->next;
-                       kfree_skb(frag);
-                       frag = skb;
-               }
+               kfree_skb_list(frag);
 
                IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
                              IPSTATS_MIB_FRAGFAILS);
index c51e8f7b8653cb167aba13f61c2d7520d615c31c..499d6c18a8ce4366a5fe61184eb7416bfb060401 100644 (file)
@@ -166,11 +166,7 @@ static int xfrm_output_gso(struct sk_buff *skb)
                err = xfrm_output2(segs);
 
                if (unlikely(err)) {
-                       while ((segs = nskb)) {
-                               nskb = segs->next;
-                               segs->next = NULL;
-                               kfree_skb(segs);
-                       }
+                       kfree_skb_list(nskb);
                        return err;
                }