aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/tipc/server.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/net/tipc/server.c b/net/tipc/server.c
index 19da5abe0fa6..fd3fa57a410e 100644
--- a/net/tipc/server.c
+++ b/net/tipc/server.c
@@ -355,8 +355,12 @@ static int tipc_open_listening_sock(struct tipc_server *s)
355 return PTR_ERR(con); 355 return PTR_ERR(con);
356 356
357 sock = tipc_create_listen_sock(con); 357 sock = tipc_create_listen_sock(con);
358 if (!sock) 358 if (!sock) {
359 idr_remove(&s->conn_idr, con->conid);
360 s->idr_in_use--;
361 kfree(con);
359 return -EINVAL; 362 return -EINVAL;
363 }
360 364
361 tipc_register_callbacks(sock, con); 365 tipc_register_callbacks(sock, con);
362 return 0; 366 return 0;
@@ -563,9 +567,14 @@ int tipc_server_start(struct tipc_server *s)
563 kmem_cache_destroy(s->rcvbuf_cache); 567 kmem_cache_destroy(s->rcvbuf_cache);
564 return ret; 568 return ret;
565 } 569 }
570 ret = tipc_open_listening_sock(s);
571 if (ret < 0) {
572 tipc_work_stop(s);
573 kmem_cache_destroy(s->rcvbuf_cache);
574 return ret;
575 }
566 s->enabled = 1; 576 s->enabled = 1;
567 577 return ret;
568 return tipc_open_listening_sock(s);
569} 578}
570 579
571void tipc_server_stop(struct tipc_server *s) 580void tipc_server_stop(struct tipc_server *s)