diff options
author | Yunsheng Lin <linyunsheng@huawei.com> | 2020-09-19 10:24:47 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-20 14:17:20 -0700 |
commit | 1f14bd99e6d393f55ca5f62dcf7bed0152ec4db6 (patch) | |
tree | 08d23bd43e755327b3aa876c7509ebe58da507f5 /net/core/skbuff.c | |
parent | 5273144116d10f66c206a068266584cc60a526ac (diff) | |
download | linux-1f14bd99e6d393f55ca5f62dcf7bed0152ec4db6.tar.bz2 |
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>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index bfd748346f20..e0774471f56d 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -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); |