aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2026-01-15 11:31:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2026-01-16 23:31:50 +0000
commit74cac745fe302b26ad22114f60735c8b73e90571 (patch)
treecc327331973bb7a50f84341c7b73e0c56c1194d5
parent988555e329d00a47c42e5e849e78c1b8e4ce2e17 (diff)
mxge(4): avoid clang 21 warning in NO-IP configuration
Building the LINT-NOIP kernel on amd64 with clang 21 results in a -Werror warning similar to: sys/dev/mxge/if_mxge.c:1846:44: error: variable 'sum' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 1846 | cksum_offset, sizeof(sum), (caddr_t)&sum); | ^~~ Indeed, if both `INET` and `INET6` are undefined, `sum` is never initialized. Initialize it to zero to silence the warning. Reviewed by: jhibbits MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54730
-rw-r--r--sys/dev/mxge/if_mxge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c
index f36f41d53b40..ca2267098c4f 100644
--- a/sys/dev/mxge/if_mxge.c
+++ b/sys/dev/mxge/if_mxge.c
@@ -1804,7 +1804,7 @@ mxge_encap_tso(struct mxge_slice_state *ss, struct mbuf *m,
uint32_t low, high_swapped;
int len, seglen, cum_len, cum_len_next;
int next_is_first, chop, cnt, rdma_count, small;
- uint16_t pseudo_hdr_offset, cksum_offset, mss, sum;
+ uint16_t pseudo_hdr_offset, cksum_offset, mss, sum = 0;
uint8_t flags, flags_next;
static int once;