[PATCH net] sfc: falcon: Fix potential stale NAPI thread references on channel copy

From: Guangshuo Li

Date: Fri Dec 04 2026 - 08:06:26 EST


Channel cloning copies the NAPI thread pointer without acquiring a
reference. If threaded NAPI is disabled by an earlier thread creation
failure, a later cloned channel can retain that old pointer. Removing
the old channels then leaves it pointing to a stopped thread.

Clear the thread pointer before initializing the copied NAPI context.

This issue was found by our static analysis tool under development.

Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support")
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
drivers/net/ethernet/sfc/falcon/efx.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index 0c197b448645..d4431b706475 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -466,6 +466,7 @@ ef4_copy_channel(const struct ef4_channel *old_channel)
INIT_HLIST_NODE(&channel->napi_str.napi_hash_node);
channel->napi_str.napi_id = 0;
channel->napi_str.state = 0;
+ channel->napi_str.thread = NULL;
memset(&channel->eventq, 0, sizeof(channel->eventq));

for (j = 0; j < EF4_TXQ_TYPES; j++) {

base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907