lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-10-11 13:16    [W:0.313 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site