diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-05 05:41:03 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-05 05:41:03 +0800 |
| commit | 5ac1ccb70a3b7d4627c257fcbb2579b2dc4d2a0a (patch) | |
| tree | 57c9fc4aae86d6dc4dacb921e673ac6b0deac26d /net/tipc/server.c | |
| parent | a4f2dc9efc00a56ca30ce340a1405293ec9488a4 (diff) | |
| parent | c095ba7224d8edc71dcef0d655911399a8bd4a3f (diff) | |
Merge 3.11-rc4 into tty-next
We want the tty fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/tipc/server.c')
| -rw-r--r-- | net/tipc/server.c | 15 |
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) return PTR_ERR(con); sock = tipc_create_listen_sock(con); - if (!sock) + if (!sock) { + idr_remove(&s->conn_idr, con->conid); + s->idr_in_use--; + kfree(con); return -EINVAL; + } tipc_register_callbacks(sock, con); return 0; @@ -563,9 +567,14 @@ int tipc_server_start(struct tipc_server *s) kmem_cache_destroy(s->rcvbuf_cache); return ret; } + ret = tipc_open_listening_sock(s); + if (ret < 0) { + tipc_work_stop(s); + kmem_cache_destroy(s->rcvbuf_cache); + return ret; + } s->enabled = 1; - - return tipc_open_listening_sock(s); + return ret; } void tipc_server_stop(struct tipc_server *s) |
