diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-03-20 05:50:50 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-03-20 06:30:37 -0400 |
commit | bec964ed3b2549086e1fdfbf7f1ce8c22f89baa4 (patch) | |
tree | 475d489bbe9e6c753e2a280094cfa7672c6d7c99 /net/nfc | |
parent | 36ef0b473fbf43d5db23eea4616cc1d18cec245f (diff) |
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: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/llcp/llcp.c | 6 | ||||
-rw-r--r-- | net/nfc/llcp/sock.c | 2 |
2 files changed, 0 insertions, 8 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index b530afadd76c..336813ff8cd5 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c | |||
@@ -107,8 +107,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, | |||
107 | accept_sk->sk_state_change(sk); | 107 | accept_sk->sk_state_change(sk); |
108 | 108 | ||
109 | bh_unlock_sock(accept_sk); | 109 | bh_unlock_sock(accept_sk); |
110 | |||
111 | sock_orphan(accept_sk); | ||
112 | } | 110 | } |
113 | 111 | ||
114 | if (listen == true) { | 112 | if (listen == true) { |
@@ -134,8 +132,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, | |||
134 | 132 | ||
135 | bh_unlock_sock(sk); | 133 | bh_unlock_sock(sk); |
136 | 134 | ||
137 | sock_orphan(sk); | ||
138 | |||
139 | sk_del_node_init(sk); | 135 | sk_del_node_init(sk); |
140 | } | 136 | } |
141 | 137 | ||
@@ -164,8 +160,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, | |||
164 | 160 | ||
165 | bh_unlock_sock(sk); | 161 | bh_unlock_sock(sk); |
166 | 162 | ||
167 | sock_orphan(sk); | ||
168 | |||
169 | sk_del_node_init(sk); | 163 | sk_del_node_init(sk); |
170 | } | 164 | } |
171 | 165 | ||
diff --git a/net/nfc/llcp/sock.c b/net/nfc/llcp/sock.c index 5c7cdf3f2a83..e488e440186a 100644 --- a/net/nfc/llcp/sock.c +++ b/net/nfc/llcp/sock.c | |||
@@ -464,8 +464,6 @@ static int llcp_sock_release(struct socket *sock) | |||
464 | nfc_llcp_accept_unlink(accept_sk); | 464 | nfc_llcp_accept_unlink(accept_sk); |
465 | 465 | ||
466 | release_sock(accept_sk); | 466 | release_sock(accept_sk); |
467 | |||
468 | sock_orphan(accept_sk); | ||
469 | } | 467 | } |
470 | } | 468 | } |
471 | 469 | ||