public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Florian Westphal <fw@strlen.de>
Cc: 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 11:07:01 -0700	[thread overview]
Message-ID: <20240829180701.GA3894635@thelio-3990X> (raw)
In-Reply-To: <20240829180205.GA22521@breakpoint.cc>

On Thu, Aug 29, 2024 at 08:02:05PM +0200, Florian Westphal wrote:
> 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.

Ah, good catch. I'll send a v2 shortly with this fixed and your ack
picked up.

Cheers,
Nathan

      reply	other threads:[~2024-08-29 18:07 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
2024-08-29 18:07     ` Nathan Chancellor [this message]

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=20240829180701.GA3894635@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=fw@strlen.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=llvm@lists.linux.dev \
    --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