]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: mptcp: Initialize variables to quiet gcc 12 warnings
authorMat Martineau <mathew.j.martineau@linux.intel.com>
Tue, 28 Jun 2022 01:02:43 +0000 (18:02 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 29 Jun 2022 03:45:43 +0000 (20:45 -0700)
commit15ff3b02dca2ae8b4489051ba839967c5faa9e05
treefece7c77ccddb8213d8362ed1f4921156be0a58c
parent076f9b039166919c0863225e00d86747276f23aa
selftests: mptcp: Initialize variables to quiet gcc 12 warnings

In a few MPTCP selftest tools, gcc 12 complains that the 'sock' variable
might be used uninitialized. This is a false positive because the only
code path that could lead to uninitialized access is where getaddrinfo()
fails, but the local xgetaddrinfo() wrapper exits if such a failure
occurs.

Initialize the 'sock' variable anyway to allow the tools to build with
gcc 12.

Fixes: 1a811ff8e5b5 ("mptcp: add basic kselftest for mptcp")
Acked-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/mptcp/mptcp_connect.c
tools/testing/selftests/net/mptcp/mptcp_inq.c
tools/testing/selftests/net/mptcp/mptcp_sockopt.c