FAILED: patch "[PATCH] selftests: mptcp: Initialize variables to quiet gcc 12" failed to apply to 5.10-stable tree
Subsystems (4)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From fd37c2ecb21f7aee04ccca5f561469f07d00063c Mon Sep 17 00:00:00 2001
From: Mat Martineau <[email protected]>
Date: Mon, 27 Jun 2022 18:02:43 -0700
Subject: [PATCH] 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.
tools/testing/selftests/net/mptcp/mptcp_connect.c +1 -1
@@ -265,7 +265,7 @@ static void sock_test_tcpulp(int sock, int proto, unsigned int line)static int sock_listen_mptcp (const char *const listenaddr,const char *const port) { -int sock; +int sock =-1 ;struct addrinfo hints = { .ai_protocol =IPPROTO_TCP , .ai_socktype =SOCK_STREAM ,
tools/testing/selftests/net/mptcp/mptcp_inq.c +1 -1
@@ -88,7 +88,7 @@ static void xgetaddrinfo(const char *node, const char *service,static int sock_listen_mptcp (const char *const listenaddr,const char *const port) { -int sock; +int sock =-1 ;struct addrinfo hints = { .ai_protocol =IPPROTO_TCP , .ai_socktype =SOCK_STREAM ,
tools/testing/selftests/net/mptcp/mptcp_sockopt.c +1 -1
@@ -136,7 +136,7 @@ static void xgetaddrinfo(const char *node, const char *service,static int sock_listen_mptcp (const char *const listenaddr,const char *const port) { -int sock; +int sock =-1 ;struct addrinfo hints = { .ai_protocol =IPPROTO_TCP , .ai_socktype =SOCK_STREAM ,