diff options
author | John Hubbard <jhubbard@nvidia.com> | 2024-05-06 21:02:04 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-05-08 02:22:18 +0200 |
commit | eb709b5f6536636dfb87b85ded0b2af9bb6cd9e6 (patch) | |
tree | 4c556106ff5518a7a177fc8faa3ef9effdbae66b /drivers/net/usb | |
parent | lib: Allow for the DIM library to be modular (diff) | |
download | linux-eb709b5f6536636dfb87b85ded0b2af9bb6cd9e6.tar.xz linux-eb709b5f6536636dfb87b85ded0b2af9bb6cd9e6.zip |
selftests/net: fix uninitialized variables
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>
Diffstat (limited to 'drivers/net/usb')
0 files changed, 0 insertions, 0 deletions