linux-stable/tools/testing
John Hubbard c80d53c484 selftests/net: fix uninitialized variables
[ Upstream commit eb709b5f65 ]

When building with clang, via:

    make LLVM=1 -C tools/testing/selftest

...clang warns about three variables that are not initialized in all
cases:

1) The opt_ipproto_off variable is used uninitialized if "testname" is
not "ip". Willem de Bruijn pointed out that this is an actual bug, and
suggested the fix that I'm using here (thanks!).

2) The addr_len is used uninitialized, but only in the assert case,
   which bails out, so this is harmless.

3) The family variable in add_listener() is only used uninitialized in
   the error case (neither IPv4 nor IPv6 is specified), so it's also
   harmless.

Fix by initializing each variable.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Acked-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20240506190204.28497-1-jhubbard@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-07-11 12:49:08 +02:00
..
crypto/chacha20-s390
cxl cxl/region: check interleave capability 2024-07-05 09:34:07 +02:00
fault-injection
ktest ktest: force $buildonly = 1 for 'make_warnings_file' test type 2024-04-13 13:07:37 +02:00
kunit kunit: tool: fix parsing of test attributes 2024-02-05 20:14:15 +00:00
memblock memblock tests: fix warning ‘struct seq_file’ declared inside parameter list 2023-09-14 10:51:28 +03:00
nvdimm
radix-tree maple_tree: do not preallocate nodes for slot stores 2024-01-05 15:19:43 +01:00
scatterlist
selftests selftests/net: fix uninitialized variables 2024-07-11 12:49:08 +02:00
vsock vsock/test: fix SEQPACKET message bounds test 2023-12-03 07:33:05 +01:00