[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251127170041.0613c50e@kernel.org>
Date: Thu, 27 Nov 2025 17:00:41 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Matthieu Baerts <matttbe@...nel.org>
Cc: Ankit Khushwaha <ankitkhushwaha.linux@...il.com>,
netdev@...r.kernel.org, mptcp@...ts.linux.dev,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, Shuah Khan <shuah@...nel.org>, Mat Martineau
<martineau@...nel.org>, Geliang Tang <geliang@...nel.org>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, Nathan
Chancellor <nathan@...nel.org>, Nick Desaulniers
<nick.desaulniers+lkml@...il.com>, Bill Wendling <morbo@...gle.com>, Justin
Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH] selftests: mptcp: initialize raw_addr to Null
On Wed, 26 Nov 2025 17:55:14 +0100 Matthieu Baerts wrote:
> I confirm this, I can reproduce the warning with Clang 21.
>
> It is indeed a false positive, because the code does that:
>
>
> if (addr.ss_family == AF_INET)
> raw_addr = &(((struct sockaddr_in *)&addr)->sin_addr);
> else if (addr.ss_family == AF_INET6)
> raw_addr = &(((struct sockaddr_in6 *)&addr)->sin6_addr);
> else
> xerror("bad family");
>
>
> "xerror()" calls "exit(1)", so "raw_addr" is never used uninitialized.
>
> I'm not sure why Clang 21 reports that now, and not before, but well,
> the modification you did in the selftests doesn't hurt:
I think annotating xerror with __noreturn is a better fix.
Including kselftest.h will be needed.
--
pw-bot: cr
Powered by blists - more mailing lists