]> www.infradead.org Git - users/jedix/linux-maple.git/commit
staging: vchiq_core: Bubble up wait_event_interruptible() return value
authorUmang Jain <umang.jain@ideasonboard.com>
Wed, 3 Jul 2024 13:10:51 +0000 (18:40 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jul 2024 12:51:18 +0000 (14:51 +0200)
commitc22502cb84d4c963f754e6d943d3133cfa80ba97
tree467febfa55a126e8b1de4afed9feed0b8a130a50
parentd3401cefd0f793037df0f36e12c2effdac517de1
staging: vchiq_core: Bubble up wait_event_interruptible() return value

wait_event_interruptible() returns if the condition evaluates to true
it receives a signal. However, the current code always assume that the
wait_event_interruptible() returns only when the event is fired.
This should not be the case as wait_event_interruptible() can
return on receiving a signal (with -ERESTARTSYS as return value).

We should consider this and bubble up the return value of
wait_event_interruptible() to exactly know if the wait has failed
and error out. This will also help to properly stop kthreads in the
subsequent patch.

Meanwhile at it, remote_wait_event() is modified to return 0 on success,
and an error code (from wait_event_interruptible()) on failure. The
return value is now checked for remote_wait_event() calls.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Tested-by: Stefan Wahren <wahrenst@gmx.net>
Link: https://lore.kernel.org/r/20240703131052.597443-2-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c