summaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-12-20 14:29:08 -0800
committerDavid S. Miller <davem@davemloft.net>2013-12-21 22:28:16 -0500
commit289dccbe141e01efc5968fe39a0993c9f611375e (patch)
tree3582a2dad5279b0a7c39abc75f5517e5ca427273 /net/core/dev.c
parent1b6176cca302e2eebd2b5ce5c512282a548adbe0 (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/core/dev.c')
-rw-r--r--net/core/dev.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index c482fe8abf8..973c2365667 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)
{
struct dev_gso_cb *cb;
- do {
- struct sk_buff *nskb = skb->next;
-
- skb->next = nskb->next;
- nskb->next = NULL;
- kfree_skb(nskb);
- } while (skb->next);
+ kfree_skb_list(skb->next);
+ skb->next = NULL;
cb = DEV_GSO_CB(skb);
if (cb->destructor)
@@ -4240,17 +4235,10 @@ EXPORT_SYMBOL(netif_napi_add);
void netif_napi_del(struct napi_struct *napi)
{
- struct sk_buff *skb, *next;
-
list_del_init(&napi->dev_list);
napi_free_frags(napi);
- for (skb = napi->gro_list; skb; skb = next) {
- next = skb->next;
- skb->next = NULL;
- kfree_skb(skb);
- }
-
+ kfree_skb_list(napi->gro_list);
napi->gro_list = NULL;
napi->gro_count = 0;
}