summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/tipc/topsrv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c
index 02013e00f287..25925be1cc08 100644
--- a/net/tipc/topsrv.c
+++ b/net/tipc/topsrv.c
@@ -580,9 +580,10 @@ bool tipc_topsrv_kern_subscr(struct net *net, u32 port, u32 type, u32 lower,
*conid = con->conid;
con->sock = NULL;
rc = tipc_conn_rcv_sub(tipc_topsrv(net), con, &sub);
- if (rc < 0)
- tipc_conn_close(con);
- return !rc;
+ if (rc >= 0)
+ return true;
+ conn_put(con);
+ return false;
}
void tipc_topsrv_kern_unsubscr(struct net *net, int conid)