Messages in this thread | | | Date | Mon, 11 Oct 2021 12:16:11 +0100 | From | Will Deacon <> | Subject | Re: [PATCH] locking/ww_mutex: set ret variable on failure |
| |
On Mon, Sep 27, 2021 at 07:57:56AM -0700, trix@redhat.com wrote: > From: Tom Rix <trix@redhat.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@redhat.com> > --- > kernel/locking/test-ww_mutex.c | 1 + > 1 file changed, 1 insertion(+)
Acked-by: Will Deacon <will@kernel.org>
Will
| |