staging: vchiq_core: Return -EINTR in queue_message() on interrupt
authorUmang Jain <umang.jain@ideasonboard.com>
Wed, 18 Sep 2024 16:30:57 +0000 (22:00 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Oct 2024 09:58:47 +0000 (11:58 +0200)
commit72925dec88342c50ca3a39c91f6614d6921bb46f
tree7995d1f6d5684ba045ae277c122fedc765e723e8
parentfbd06c751a5c2092484f6a43fed0120ee8844d6a
staging: vchiq_core: Return -EINTR in queue_message() on interrupt

queue_message() uses mutex_lock_killable() and
wait_for_completion_killable() variations of locking and wait event
completions respectively. These functions return either 0 (on success)
or -EINTR, if interrupted by a fatal signal (as documented in the
kernel).

However, queue_message() is currently returning -EAGAIN if these
killable functions are interrupted by fatal signals. Bubbling up
-EAGAIN might give a sense to the caller, that the code path can
be re-tried however, in actual sense, a fatal signal has been
received by the process and the process is going away.

Hence, we should align the return value with what these killable
versions will return i.e. -EINTR (Interrupted system call).

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20240918163100.870596-4-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c