From: Florian Westphal <fw@strlen.de>
To: Florian Westphal <fw@strlen.de>
Cc: Nathan Chancellor <nathan@kernel.org>,
Steffen Klassert <steffen.klassert@secunet.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
netdev@vger.kernel.org, llvm@lists.linux.dev,
patches@lists.linux.dev
Subject: Re: [PATCH] xfrm: policy: Restore dir assignment in xfrm_hash_rebuild()
Date: Thu, 29 Aug 2024 20:02:05 +0200 [thread overview]
Message-ID: <20240829180205.GA22521@breakpoint.cc> (raw)
In-Reply-To: <20240829175411.GA22324@breakpoint.cc>
Florian Westphal <fw@strlen.de> wrote:
> Nathan Chancellor <nathan@kernel.org> wrote:
> > Clang warns (or errors with CONFIG_WERROR):
> >
> > net/xfrm/xfrm_policy.c:1286:8: error: variable 'dir' is uninitialized when used here [-Werror,-Wuninitialized]
> > 1286 | if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) {
> > | ^~~
> > net/xfrm/xfrm_policy.c:1257:9: note: initialize the variable 'dir' to silence this warning
> > 1257 | int dir;
> > | ^
> > | = 0
> > 1 error generated.
>
> Ugh, my bad.
>
> Acked-by: Florian Westphal <fw@strlen.de>
Actually, this fix is incomplete, the assignment needs to be
restored in the second loop as well:
1340 chain = policy_hash_bysel(net, &policy->selector,
1341 policy->family, dir);
~~~
Nathan, Steffen, I'll leave it up to you to either do a v2 or a revert.
next prev parent reply other threads:[~2024-08-29 18:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 17:09 [PATCH] xfrm: policy: Restore dir assignment in xfrm_hash_rebuild() Nathan Chancellor
2024-08-29 17:54 ` Florian Westphal
2024-08-29 18:02 ` Florian Westphal [this message]
2024-08-29 18:07 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240829180205.GA22521@breakpoint.cc \
--to=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox