[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240829180701.GA3894635@thelio-3990X>
Date: Thu, 29 Aug 2024 11:07:01 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Florian Westphal <fw@...len.de>
Cc: Steffen Klassert <steffen.klassert@...unet.com>,
Herbert Xu <herbert@...dor.apana.org.au>, netdev@...r.kernel.org,
llvm@...ts.linux.dev, patches@...ts.linux.dev
Subject: Re: [PATCH] xfrm: policy: Restore dir assignment in
xfrm_hash_rebuild()
On Thu, Aug 29, 2024 at 08:02:05PM +0200, Florian Westphal wrote:
> Florian Westphal <fw@...len.de> wrote:
> > Nathan Chancellor <nathan@...nel.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@...len.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
Powered by blists - more mailing lists