mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 17:24:17 +08:00
net: remove unnecessary NULL checking in napi_consume_skb()
When budget is non-zero, skb_unref() has already handled the NULL checking. When budget is zero, the dev_consume_skb_any() has handled NULL checking in __dev_kfree_skb_irq(), or dev_kfree_skb() which also ultimately call skb_unref(). So remove the unnecessary checking in napi_consume_skb(). Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5273144116
commit
1f14bd99e6
@ -895,9 +895,6 @@ void __kfree_skb_defer(struct sk_buff *skb)
|
||||
|
||||
void napi_consume_skb(struct sk_buff *skb, int budget)
|
||||
{
|
||||
if (unlikely(!skb))
|
||||
return;
|
||||
|
||||
/* Zero budget indicate non-NAPI context called us, like netpoll */
|
||||
if (unlikely(!budget)) {
|
||||
dev_consume_skb_any(skb);
|
||||
|
Loading…
Reference in New Issue
Block a user