aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/name_table.c3
-rw-r--r--net/tipc/port.c9
-rw-r--r--net/tipc/socket.c13
3 files changed, 8 insertions, 17 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index 09dcd54b04e1..92a1533af4e0 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -148,8 +148,7 @@ static struct publication *publ_create(u32 type, u32 lower, u32 upper,
148 */ 148 */
149static struct sub_seq *tipc_subseq_alloc(u32 cnt) 149static struct sub_seq *tipc_subseq_alloc(u32 cnt)
150{ 150{
151 struct sub_seq *sseq = kcalloc(cnt, sizeof(struct sub_seq), GFP_ATOMIC); 151 return kcalloc(cnt, sizeof(struct sub_seq), GFP_ATOMIC);
152 return sseq;
153} 152}
154 153
155/** 154/**
diff --git a/net/tipc/port.c b/net/tipc/port.c
index c081a7632302..5fd4c8cec08e 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -832,17 +832,14 @@ exit:
832 */ 832 */
833int __tipc_disconnect(struct tipc_port *tp_ptr) 833int __tipc_disconnect(struct tipc_port *tp_ptr)
834{ 834{
835 int res;
836
837 if (tp_ptr->connected) { 835 if (tp_ptr->connected) {
838 tp_ptr->connected = 0; 836 tp_ptr->connected = 0;
839 /* let timer expire on it's own to avoid deadlock! */ 837 /* let timer expire on it's own to avoid deadlock! */
840 tipc_nodesub_unsubscribe(&tp_ptr->subscription); 838 tipc_nodesub_unsubscribe(&tp_ptr->subscription);
841 res = 0; 839 return 0;
842 } else {
843 res = -ENOTCONN;
844 } 840 }
845 return res; 841
842 return -ENOTCONN;
846} 843}
847 844
848/* 845/*
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 3b61851bb927..32037c57937d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -239,7 +239,6 @@ static int tipc_sk_create(struct net *net, struct socket *sock, int protocol,
239int tipc_sock_create_local(int type, struct socket **res) 239int tipc_sock_create_local(int type, struct socket **res)
240{ 240{
241 int rc; 241 int rc;
242 struct sock *sk;
243 242
244 rc = sock_create_lite(AF_TIPC, type, 0, res); 243 rc = sock_create_lite(AF_TIPC, type, 0, res);
245 if (rc < 0) { 244 if (rc < 0) {
@@ -248,8 +247,6 @@ int tipc_sock_create_local(int type, struct socket **res)
248 } 247 }
249 tipc_sk_create(&init_net, *res, 0, 1); 248 tipc_sk_create(&init_net, *res, 0, 1);
250 249
251 sk = (*res)->sk;
252
253 return 0; 250 return 0;
254} 251}
255 252
@@ -1311,14 +1308,12 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf)
1311static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *buf) 1308static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *buf)
1312{ 1309{
1313 struct tipc_msg *msg = buf_msg(buf); 1310 struct tipc_msg *msg = buf_msg(buf);
1314 unsigned int limit;
1315 1311
1316 if (msg_connected(msg)) 1312 if (msg_connected(msg))
1317 limit = sysctl_tipc_rmem[2]; 1313 return sysctl_tipc_rmem[2];
1318 else 1314
1319 limit = sk->sk_rcvbuf >> TIPC_CRITICAL_IMPORTANCE << 1315 return sk->sk_rcvbuf >> TIPC_CRITICAL_IMPORTANCE <<
1320 msg_importance(msg); 1316 msg_importance(msg);
1321 return limit;
1322} 1317}
1323 1318
1324/** 1319/**