diff options
author | Eric Dumazet <edumazet@google.com> | 2013-12-20 17:29:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-21 22:28:16 -0500 |
commit | 289dccbe141e01efc5968fe39a0993c9f611375e (patch) | |
tree | 3582a2dad5279b0a7c39abc75f5517e5ca427273 /net | |
parent | 1b6176cca302e2eebd2b5ce5c512282a548adbe0 (diff) |
net: use kfree_skb_list() helper
We can use kfree_skb_list() instead of open coding it.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 18 | ||||
-rw-r--r-- | net/core/skbuff.c | 5 |
2 files changed, 4 insertions, 19 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index c482fe8abf87..973c23656673 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2454,13 +2454,8 @@ static void dev_gso_skb_destructor(struct sk_buff *skb) | |||
2454 | { | 2454 | { |
2455 | struct dev_gso_cb *cb; | 2455 | struct dev_gso_cb *cb; |
2456 | 2456 | ||
2457 | do { | 2457 | kfree_skb_list(skb->next); |
2458 | struct sk_buff *nskb = skb->next; | 2458 | skb->next = NULL; |
2459 | |||
2460 | skb->next = nskb->next; | ||
2461 | nskb->next = NULL; | ||
2462 | kfree_skb(nskb); | ||
2463 | } while (skb->next); | ||
2464 | 2459 | ||
2465 | cb = DEV_GSO_CB(skb); | 2460 | cb = DEV_GSO_CB(skb); |
2466 | if (cb->destructor) | 2461 | if (cb->destructor) |
@@ -4240,17 +4235,10 @@ EXPORT_SYMBOL(netif_napi_add); | |||
4240 | 4235 | ||
4241 | void netif_napi_del(struct napi_struct *napi) | 4236 | void netif_napi_del(struct napi_struct *napi) |
4242 | { | 4237 | { |
4243 | struct sk_buff *skb, *next; | ||
4244 | |||
4245 | list_del_init(&napi->dev_list); | 4238 | list_del_init(&napi->dev_list); |
4246 | napi_free_frags(napi); | 4239 | napi_free_frags(napi); |
4247 | 4240 | ||
4248 | for (skb = napi->gro_list; skb; skb = next) { | 4241 | kfree_skb_list(napi->gro_list); |
4249 | next = skb->next; | ||
4250 | skb->next = NULL; | ||
4251 | kfree_skb(skb); | ||
4252 | } | ||
4253 | |||
4254 | napi->gro_list = NULL; | 4242 | napi->gro_list = NULL; |
4255 | napi->gro_count = 0; | 4243 | napi->gro_count = 0; |
4256 | } | 4244 | } |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 2b6b863f51f2..eb96c2c22400 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2981,10 +2981,7 @@ perform_csum_check: | |||
2981 | return segs; | 2981 | return segs; |
2982 | 2982 | ||
2983 | err: | 2983 | err: |
2984 | while ((skb = segs)) { | 2984 | kfree_skb_list(segs); |
2985 | segs = skb->next; | ||
2986 | kfree_skb(skb); | ||
2987 | } | ||
2988 | return ERR_PTR(err); | 2985 | return ERR_PTR(err); |
2989 | } | 2986 | } |
2990 | EXPORT_SYMBOL_GPL(skb_segment); | 2987 | EXPORT_SYMBOL_GPL(skb_segment); |