mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 21:24:08 +08:00
can: j1939: transport: j1939_cancel_active_session(): use hrtimer_try_to_cancel() instead of hrtimer_cancel()
This part of the code protected by lock used in the hrtimer as well.
Using hrtimer_cancel() will trigger dead lock.
Fixes: 9d71dd0c70
("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
This commit is contained in:
parent
62ebce1dc1
commit
8d7a5f000e
@ -2039,7 +2039,11 @@ int j1939_cancel_active_session(struct j1939_priv *priv, struct sock *sk)
|
||||
&priv->active_session_list,
|
||||
active_session_list_entry) {
|
||||
if (!sk || sk == session->sk) {
|
||||
j1939_session_timers_cancel(session);
|
||||
if (hrtimer_try_to_cancel(&session->txtimer) == 1)
|
||||
j1939_session_put(session);
|
||||
if (hrtimer_try_to_cancel(&session->rxtimer) == 1)
|
||||
j1939_session_put(session);
|
||||
|
||||
session->err = ESHUTDOWN;
|
||||
j1939_session_deactivate_locked(session);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user