aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/nfc/llcp/llcp.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index 83e788e840a0..99ec39d6e937 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -76,7 +76,7 @@ static void nfc_llcp_socket_purge(struct nfc_llcp_sock *sock)
76 } 76 }
77} 77}
78 78
79static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen, 79static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool device,
80 int err) 80 int err)
81{ 81{
82 struct sock *sk; 82 struct sock *sk;
@@ -116,23 +116,6 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
116 116
117 bh_unlock_sock(accept_sk); 117 bh_unlock_sock(accept_sk);
118 } 118 }
119
120 if (listen == true) {
121 nfc_llcp_socket_remote_param_init(llcp_sock);
122 bh_unlock_sock(sk);
123 continue;
124 }
125 }
126
127 /*
128 * If we have a connection less socket bound, we keep it alive
129 * if the device is still present.
130 */
131 if (sk->sk_state == LLCP_BOUND && sk->sk_type == SOCK_DGRAM &&
132 listen == true) {
133 nfc_llcp_socket_remote_param_init(llcp_sock);
134 bh_unlock_sock(sk);
135 continue;
136 } 119 }
137 120
138 if (err) 121 if (err)
@@ -147,11 +130,8 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool listen,
147 130
148 write_unlock(&local->sockets.lock); 131 write_unlock(&local->sockets.lock);
149 132
150 /* 133 /* If we still have a device, we keep the RAW sockets alive */
151 * If we want to keep the listening sockets alive, 134 if (device == true)
152 * we don't touch the RAW ones.
153 */
154 if (listen == true)
155 return; 135 return;
156 136
157 write_lock(&local->raw_sockets.lock); 137 write_lock(&local->raw_sockets.lock);