From 4c03592689bc19df9deda7a33d56c6ac0cec8651 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Wed, 26 Nov 2025 17:43:11 -0800 Subject: [PATCH] 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 --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.47.3