diff options
Diffstat (limited to 'net/tipc/server.c')
-rw-r--r-- | net/tipc/server.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/net/tipc/server.c b/net/tipc/server.c index 2e803601aa99..826cde2c401e 100644 --- a/net/tipc/server.c +++ b/net/tipc/server.c | |||
@@ -86,7 +86,6 @@ struct outqueue_entry { | |||
86 | static void tipc_recv_work(struct work_struct *work); | 86 | static void tipc_recv_work(struct work_struct *work); |
87 | static void tipc_send_work(struct work_struct *work); | 87 | static void tipc_send_work(struct work_struct *work); |
88 | static void tipc_clean_outqueues(struct tipc_conn *con); | 88 | static void tipc_clean_outqueues(struct tipc_conn *con); |
89 | static void tipc_sock_release(struct tipc_conn *con); | ||
90 | 89 | ||
91 | static void tipc_conn_kref_release(struct kref *kref) | 90 | static void tipc_conn_kref_release(struct kref *kref) |
92 | { | 91 | { |
@@ -104,7 +103,6 @@ static void tipc_conn_kref_release(struct kref *kref) | |||
104 | } | 103 | } |
105 | saddr->scope = -TIPC_NODE_SCOPE; | 104 | saddr->scope = -TIPC_NODE_SCOPE; |
106 | kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr)); | 105 | kernel_bind(sock, (struct sockaddr *)saddr, sizeof(*saddr)); |
107 | tipc_sock_release(con); | ||
108 | sock_release(sock); | 106 | sock_release(sock); |
109 | con->sock = NULL; | 107 | con->sock = NULL; |
110 | 108 | ||
@@ -194,19 +192,15 @@ static void tipc_unregister_callbacks(struct tipc_conn *con) | |||
194 | write_unlock_bh(&sk->sk_callback_lock); | 192 | write_unlock_bh(&sk->sk_callback_lock); |
195 | } | 193 | } |
196 | 194 | ||
197 | static void tipc_sock_release(struct tipc_conn *con) | 195 | static void tipc_close_conn(struct tipc_conn *con) |
198 | { | 196 | { |
199 | struct tipc_server *s = con->server; | 197 | struct tipc_server *s = con->server; |
200 | 198 | ||
201 | if (con->conid) | ||
202 | s->tipc_conn_release(con->conid, con->usr_data); | ||
203 | |||
204 | tipc_unregister_callbacks(con); | ||
205 | } | ||
206 | |||
207 | static void tipc_close_conn(struct tipc_conn *con) | ||
208 | { | ||
209 | if (test_and_clear_bit(CF_CONNECTED, &con->flags)) { | 199 | if (test_and_clear_bit(CF_CONNECTED, &con->flags)) { |
200 | tipc_unregister_callbacks(con); | ||
201 | |||
202 | if (con->conid) | ||
203 | s->tipc_conn_release(con->conid, con->usr_data); | ||
210 | 204 | ||
211 | /* We shouldn't flush pending works as we may be in the | 205 | /* We shouldn't flush pending works as we may be in the |
212 | * thread. In fact the races with pending rx/tx work structs | 206 | * thread. In fact the races with pending rx/tx work structs |