diff options
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bearer.c | 9 | ||||
-rw-r--r-- | net/tipc/server.c | 15 |
2 files changed, 19 insertions, 5 deletions
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index cb29ef7ba2f0..609c30c80816 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -460,6 +460,7 @@ static void bearer_disable(struct tipc_bearer *b_ptr) | |||
460 | { | 460 | { |
461 | struct tipc_link *l_ptr; | 461 | struct tipc_link *l_ptr; |
462 | struct tipc_link *temp_l_ptr; | 462 | struct tipc_link *temp_l_ptr; |
463 | struct tipc_link_req *temp_req; | ||
463 | 464 | ||
464 | pr_info("Disabling bearer <%s>\n", b_ptr->name); | 465 | pr_info("Disabling bearer <%s>\n", b_ptr->name); |
465 | spin_lock_bh(&b_ptr->lock); | 466 | spin_lock_bh(&b_ptr->lock); |
@@ -468,9 +469,13 @@ static void bearer_disable(struct tipc_bearer *b_ptr) | |||
468 | list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { | 469 | list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { |
469 | tipc_link_delete(l_ptr); | 470 | tipc_link_delete(l_ptr); |
470 | } | 471 | } |
471 | if (b_ptr->link_req) | 472 | temp_req = b_ptr->link_req; |
472 | tipc_disc_delete(b_ptr->link_req); | 473 | b_ptr->link_req = NULL; |
473 | spin_unlock_bh(&b_ptr->lock); | 474 | spin_unlock_bh(&b_ptr->lock); |
475 | |||
476 | if (temp_req) | ||
477 | tipc_disc_delete(temp_req); | ||
478 | |||
474 | memset(b_ptr, 0, sizeof(struct tipc_bearer)); | 479 | memset(b_ptr, 0, sizeof(struct tipc_bearer)); |
475 | } | 480 | } |
476 | 481 | ||
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 | ||
571 | void tipc_server_stop(struct tipc_server *s) | 580 | void tipc_server_stop(struct tipc_server *s) |