hidp: Ensure the session is marked as terminating to enable other functions to abort early.
Subsystems (2)
PATCH 1/1 hidp: Ensure the session is marked as terminating to enable other functions to abort early.
From: Karl Relton <[email protected]>
Ensure the session is marked as terminating no matter how hidp_session drops out of its main loop.
This enables other functions (such as hidp_get_raw_report) to abort early once a session is in its closing
stages - important since the cleanup of a session will remove input/hid devices which (via the power_supply code) will typically trigger a call to hidp_get_raw_report for an ill-fated attempt to get the battery status. Without this change hidp_get_raw_report can end up stalling the cleanup process for its 5 second timeout.
Signed-off-by Karl Relton <[email protected]>
Reviewed-by David Herrmann <[email protected]>
--- net/bluetooth/hidp/core.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/hidp/core.c +1 -0
@@ -722,6 +722,7 @@ static int hidp_session(void *arg)set_current_state (TASK_INTERRUPTIBLE ); }set_current_state (TASK_RUNNING ); +atomic_inc (&session->terminate);remove_wait_queue (sk_sleep (intr_sk), &intr_wait);remove_wait_queue (sk_sleep (ctrl_sk), &ctrl_wait);
Signature · 1 line
1.7.9.5