Skip to content

Commit 46cfd72

Browse files
Florian Westphaldavem330
authored andcommitted
net: use kfree_skb_list() helper in more places
Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 72bb17b commit 46cfd72

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

net/ipv6/ip6_output.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,11 +701,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
701701
return 0;
702702
}
703703

704-
while (frag) {
705-
skb = frag->next;
706-
kfree_skb(frag);
707-
frag = skb;
708-
}
704+
kfree_skb_list(frag);
709705

710706
IP6_INC_STATS(net, ip6_dst_idev(&rt->dst),
711707
IPSTATS_MIB_FRAGFAILS);

net/xfrm/xfrm_output.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,7 @@ static int xfrm_output_gso(struct sk_buff *skb)
166166
err = xfrm_output2(segs);
167167

168168
if (unlikely(err)) {
169-
while ((segs = nskb)) {
170-
nskb = segs->next;
171-
segs->next = NULL;
172-
kfree_skb(segs);
173-
}
169+
kfree_skb_list(nskb);
174170
return err;
175171
}
176172

0 commit comments

Comments
 (0)