From: Jakub Kicinski Date: Thu, 27 Nov 2025 01:43:11 +0000 (-0800) Subject: net: restore napi_consume_skb()'s NULL-handling X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4c03592689bc19df9deda7a33d56c6ac0cec8651;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Jakub Kicinski --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 5a1d123e7ef74..a00808f7be6a1 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -1490,7 +1490,7 @@ void napi_skb_free_stolen_head(struct sk_buff *skb) void napi_consume_skb(struct sk_buff *skb, int budget) { /* Zero budget indicate non-NAPI context called us, like netpoll */ - if (unlikely(!budget)) { + if (unlikely(!budget || !skb)) { dev_consume_skb_any(skb); return; }