From 3ce5d47f2cc0b779b243b90a4594a26911bc41af Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 15 Apr 2026 14:05:30 -0700 Subject: [PATCH] Initialize resp_data to silence clang uninitialized warning Clang flow analysis flags resp_data in process_response as possibly uninitialized when find_request returns NULL. kmod/src/net.c:533:6: error: variable 'resp_data' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] In practice the read is harmless because resp_func stays NULL in that path and call_resp_func only dereferences resp_data when resp_func is non-NULL. Initialize at declaration. Signed-off-by: Auke Kok --- kmod/src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/net.c b/kmod/src/net.c index 8e7cdb4c..f2bec750 100644 --- a/kmod/src/net.c +++ b/kmod/src/net.c @@ -525,7 +525,7 @@ static int process_response(struct scoutfs_net_connection *conn, struct super_block *sb = conn->sb; struct message_send *msend; scoutfs_net_response_t resp_func = NULL; - void *resp_data; + void *resp_data = NULL; spin_lock(&conn->lock);