Commit bec964ed authored by Samuel Ortiz's avatar Samuel Ortiz

NFC: llcp: Detach socket from process context only when releasing the socket

Calling sock_orphan when e.g. the NFC adapter is removed can lead to
kernel crashes when e.g. a connection less client is sleeping on the
Rx workqueue, waiting for data to show up.
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 36ef0b47
...@@ -107,8 +107,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, ...@@ -107,8 +107,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
accept_sk->sk_state_change(sk); accept_sk->sk_state_change(sk);
bh_unlock_sock(accept_sk); bh_unlock_sock(accept_sk);
sock_orphan(accept_sk);
} }
if (listen == true) { if (listen == true) {
...@@ -134,8 +132,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, ...@@ -134,8 +132,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
bh_unlock_sock(sk); bh_unlock_sock(sk);
sock_orphan(sk);
sk_del_node_init(sk); sk_del_node_init(sk);
} }
...@@ -164,8 +160,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, ...@@ -164,8 +160,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
bh_unlock_sock(sk); bh_unlock_sock(sk);
sock_orphan(sk);
sk_del_node_init(sk); sk_del_node_init(sk);
} }
......
...@@ -464,8 +464,6 @@ static int llcp_sock_release(struct socket *sock) ...@@ -464,8 +464,6 @@ static int llcp_sock_release(struct socket *sock)
nfc_llcp_accept_unlink(accept_sk); nfc_llcp_accept_unlink(accept_sk);
release_sock(accept_sk); release_sock(accept_sk);
sock_orphan(accept_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