aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/llcp/llcp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index 77e1d97b3996..8a35423ead54 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -133,6 +133,35 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen)
133 } 133 }
134 134
135 write_unlock(&local->sockets.lock); 135 write_unlock(&local->sockets.lock);
136
137 /*
138 * If we want to keep the listening sockets alive,
139 * we don't touch the RAW ones.
140 */
141 if (listen == true)
142 return;
143
144 write_lock(&local->raw_sockets.lock);
145
146 sk_for_each_safe(sk, tmp, &local->raw_sockets.head) {
147 llcp_sock = nfc_llcp_sock(sk);
148
149 bh_lock_sock(sk);
150
151 nfc_llcp_socket_purge(llcp_sock);
152
153 sk->sk_state = LLCP_CLOSED;
154
155 sk->sk_state_change(sk);
156
157 bh_unlock_sock(sk);
158
159 sock_orphan(sk);
160
161 sk_del_node_init(sk);
162 }
163
164 write_unlock(&local->raw_sockets.lock);
136} 165}
137 166
138struct nfc_llcp_local *nfc_llcp_local_get(struct nfc_llcp_local *local) 167struct nfc_llcp_local *nfc_llcp_local_get(struct nfc_llcp_local *local)