Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: restore napi_consume_skb()'s NULL-handling

Commit e20dfbad8aab ("net: fix napi_consume_skb() with alien skbs")
added a skb->cpu check to napi_consume_skb(), before the point where
napi_consume_skb() validated skb is not NULL.

Add an explicit check to the early exit condition.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+1 -1
+1 -1
net/core/skbuff.c
··· 1490 1490 void napi_consume_skb(struct sk_buff *skb, int budget) 1491 1491 { 1492 1492 /* Zero budget indicate non-NAPI context called us, like netpoll */ 1493 - if (unlikely(!budget)) { 1493 + if (unlikely(!budget || !skb)) { 1494 1494 dev_consume_skb_any(skb); 1495 1495 return; 1496 1496 }