Re: [PATCH v2] selftests/net: fix uninitialized variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 6 May 2024, John Hubbard wrote:

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.

Cc: Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>
Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>

Hi John -

MPTCP change looks good to me:

Acked-by: Mat Martineau <martineau@xxxxxxxxxx>





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux