Commit 43dff98b authored by Shaun Pereira's avatar Shaun Pereira Committed by David S. Miller

[X25]: fix for spinlock recurse and spinlock lockup with timer handler

When the sk_timer function x25_heartbeat_expiry() is called by the
kernel in a running/terminating process, spinlock-recursion and
spinlock-lockup locks up the kernel.  This has happened with testing
on some distro's and the patch below fixed it.
Signed-off-by: default avatarShaun Pereira <spereira@tusc.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0a515bc
...@@ -114,8 +114,9 @@ static void x25_heartbeat_expiry(unsigned long param) ...@@ -114,8 +114,9 @@ static void x25_heartbeat_expiry(unsigned long param)
if (sock_flag(sk, SOCK_DESTROY) || if (sock_flag(sk, SOCK_DESTROY) ||
(sk->sk_state == TCP_LISTEN && (sk->sk_state == TCP_LISTEN &&
sock_flag(sk, SOCK_DEAD))) { sock_flag(sk, SOCK_DEAD))) {
bh_unlock_sock(sk);
x25_destroy_socket(sk); x25_destroy_socket(sk);
goto unlock; return;
} }
break; break;
...@@ -128,7 +129,6 @@ static void x25_heartbeat_expiry(unsigned long param) ...@@ -128,7 +129,6 @@ static void x25_heartbeat_expiry(unsigned long param)
} }
restart_heartbeat: restart_heartbeat:
x25_start_heartbeat(sk); x25_start_heartbeat(sk);
unlock:
bh_unlock_sock(sk); bh_unlock_sock(sk);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment