From: Jarek Poplawski Date: Thu, 20 Mar 2008 23:07:27 +0000 (-0700) Subject: netpoll: zap_completion_queue: adjust skb->users counter X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a455b087c9629b3ae3b521b4f1ed16672f978cc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git netpoll: zap_completion_queue: adjust skb->users counter zap_completion_queue() retrieves skbs from completion_queue where they have zero skb->users counter. Before dev_kfree_skb_any() it should be non-zero yet, so it's increased now. Reported-and-tested-by: Andrew Morton Signed-off-by: Jarek Poplawski Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 4b7e756181c9..c635de52526c 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -215,10 +215,12 @@ static void zap_completion_queue(void) while (clist != NULL) { struct sk_buff *skb = clist; clist = clist->next; - if (skb->destructor) + if (skb->destructor) { + atomic_inc(&skb->users); dev_kfree_skb_any(skb); /* put this one back */ - else + } else { __kfree_skb(skb); + } } }