]> git.baikalelectronics.ru Git - kernel.git/commit
futex: Return error code instead of assigning it without effect
authorColin Ian King <colin.king@canonical.com>
Wed, 18 Aug 2021 13:18:40 +0000 (14:18 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 2 Sep 2021 20:07:18 +0000 (22:07 +0200)
commitb1e535d4a79ea39316266eea01faf2582dc02639
treecbb228b620a015624f929d691f54c7d22a77130d
parent651dac2cd0dea2151c27d2f268d96674b3b9a88a
futex: Return error code instead of assigning it without effect

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
ineffective.

Return -EINVAL rather than assigning it to ret which was the original
intent.

Fixes: 9053cceb553f ("futex: Validate waiter correctly in futex_proxy_trylock_atomic()")
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: André Almeida <andrealmeid@collabora.com>
Link: https://lore.kernel.org/r/20210818131840.34262-1-colin.king@canonical.com
kernel/futex.c