]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
greybus: gb-beagleplay: Fix timeout handling in bootloader functions
authorHaotian Zhang <vulab@iscas.ac.cn>
Fri, 21 Nov 2025 06:40:27 +0000 (14:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:21 +0000 (14:03 +0100)
commit2f62a4e395883ec5a25b6c5a832373459e22f7f3
tree61f250c2e4e4e6d0f1da27f94868f3ba15544df9
parentc9083b2fce6b3bddceba7c4166ce3013f2941e0e
greybus: gb-beagleplay: Fix timeout handling in bootloader functions

[ Upstream commit e6df0f649cff08da7a2feb6d963b39076ca129f9 ]

wait_for_completion_timeout() returns the remaining jiffies
(at least 1) on success or 0 on timeout, but never negative
error codes. The current code incorrectly checks for negative
values, causing timeouts to be ignored and treated as success.

Check for a zero return value to correctly identify and
handle timeout events.

Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20251121064027.571-1-vulab@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/greybus/gb-beagleplay.c