[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211011111610.GD4068@willie-the-truck>
Date: Mon, 11 Oct 2021 12:16:11 +0100
From: Will Deacon <will@...nel.org>
To: trix@...hat.com
Cc: peterz@...radead.org, mingo@...hat.com, longman@...hat.com,
boqun.feng@...il.com, nathan@...nel.org, ndesaulniers@...gle.com,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] locking/ww_mutex: set ret variable on failure
On Mon, Sep 27, 2021 at 07:57:56AM -0700, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
>
> Building with clang 13 produces this error
> test-ww_mutex.c:138:7: error: variable 'ret' is used
> uninitialized whenever 'if' condition is true
> [-Werror,-Wsometimes-uninitialized]
> if (!ww_mutex_trylock(&mutex, &ctx)) {
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> On this failure set ret to -EINVAL as is similarly done
> in the function.
>
> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
> kernel/locking/test-ww_mutex.c | 1 +
> 1 file changed, 1 insertion(+)
Acked-by: Will Deacon <will@...nel.org>
Will
Powered by blists - more mailing lists