[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210901202425.v5sym64dqjzakimb@offworld>
Date: Wed, 1 Sep 2021 13:24:25 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Colin King <colin.king@...onical.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Darren Hart <dvhart@...radead.org>,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] futex: fix assigned ret variable that is never read
On Wed, 18 Aug 2021, Colin King wrote:
>From: Colin Ian King <colin.king@...onical.com>
>
>Currently the check on the rt_waiter and top_waiter->pi_state is
>assigning an error return code to ret but this later gets re-assigned,
>hence the check is currently ineffective. I believe the original
>intent was to return -EINVAL rather than assign it to ret. Fix this.
LGTM.
Acked-by: Davidlohr Bueso <dbueso@...e.de>
>
>Addresses-Coverity: ("Unused value")
>Fixes: dc7109aaa233 ("futex: Validate waiter correctly in futex_proxy_trylock_atomic()")
>Signed-off-by: Colin Ian King <colin.king@...onical.com>
>---
> kernel/futex.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/kernel/futex.c b/kernel/futex.c
>index e7b4c6121da4..30e7daebaec8 100644
>--- a/kernel/futex.c
>+++ b/kernel/futex.c
>@@ -2025,7 +2025,7 @@ futex_proxy_trylock_atomic(u32 __user *pifutex, struct futex_hash_bucket *hb1,
> * and waiting on the 'waitqueue' futex which is always !PI.
> */
> if (!top_waiter->rt_waiter || top_waiter->pi_state)
>- ret = -EINVAL;
>+ return -EINVAL;
>
> /* Ensure we requeue to the expected futex. */
> if (!match_futex(top_waiter->requeue_pi_key, key2))
>--
>2.32.0
>
Powered by blists - more mailing lists