From 2f48a606e8d24ca45a7248f4566b869afb47541b Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Thu, 8 May 2025 15:17:44 -0700 Subject: [PATCH] Fix -Wmaybe-uninitalized since rhel9.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like the compiler isn't smart enough to understand the pass by pointer value, and we can initialize it here easily. make[1]: Entering directory '/usr/src/kernels/5.14.0-503.26.1.el9_5.x86_64' CC [M] /home/auke/scoutfs/kmod/src/server.o /home/auke/scoutfs/kmod/src/server.c: In function ‘fence_pending_recov_worker’: /home/auke/scoutfs/kmod/src/server.c:4170:23: error: ‘addr.v4.addr’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 4170 | ret = scoutfs_fence_start(sb, rid, le32_to_be32(addr.v4.addr), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4171 | SCOUTFS_FENCE_CLIENT_RECOVERY); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors There's still the obvious issue here that we'd intended to support ipv6 but just disregard that here. Signed-off-by: Auke Kok --- kmod/src/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod/src/server.c b/kmod/src/server.c index f4e09031..9244f8d2 100644 --- a/kmod/src/server.c +++ b/kmod/src/server.c @@ -4153,7 +4153,7 @@ static void fence_pending_recov_worker(struct work_struct *work) struct server_info *server = container_of(work, struct server_info, fence_pending_recov_work); struct super_block *sb = server->sb; - union scoutfs_inet_addr addr; + union scoutfs_inet_addr addr = {{0,}}; u64 rid = 0; int ret = 0;