Commit 289dccbe authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: use kfree_skb_list() helper

We can use kfree_skb_list() instead of open coding it.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b6176cc
...@@ -2454,13 +2454,8 @@ static void dev_gso_skb_destructor(struct sk_buff *skb) ...@@ -2454,13 +2454,8 @@ static void dev_gso_skb_destructor(struct sk_buff *skb)
{ {
struct dev_gso_cb *cb; struct dev_gso_cb *cb;
do { kfree_skb_list(skb->next);
struct sk_buff *nskb = skb->next; skb->next = NULL;
skb->next = nskb->next;
nskb->next = NULL;
kfree_skb(nskb);
} while (skb->next);
cb = DEV_GSO_CB(skb); cb = DEV_GSO_CB(skb);
if (cb->destructor) if (cb->destructor)
...@@ -4240,17 +4235,10 @@ EXPORT_SYMBOL(netif_napi_add); ...@@ -4240,17 +4235,10 @@ EXPORT_SYMBOL(netif_napi_add);
void netif_napi_del(struct napi_struct *napi) void netif_napi_del(struct napi_struct *napi)
{ {
struct sk_buff *skb, *next;
list_del_init(&napi->dev_list); list_del_init(&napi->dev_list);
napi_free_frags(napi); napi_free_frags(napi);
for (skb = napi->gro_list; skb; skb = next) { kfree_skb_list(napi->gro_list);
next = skb->next;
skb->next = NULL;
kfree_skb(skb);
}
napi->gro_list = NULL; napi->gro_list = NULL;
napi->gro_count = 0; napi->gro_count = 0;
} }
......
...@@ -2981,10 +2981,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features) ...@@ -2981,10 +2981,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
return segs; return segs;
err: err:
while ((skb = segs)) { kfree_skb_list(segs);
segs = skb->next;
kfree_skb(skb);
}
return ERR_PTR(err); return ERR_PTR(err);
} }
EXPORT_SYMBOL_GPL(skb_segment); EXPORT_SYMBOL_GPL(skb_segment);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment