aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 38f48795b40e..9c362c5759ba 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -2,7 +2,7 @@
2 * net/tipc/socket.c: TIPC socket API 2 * net/tipc/socket.c: TIPC socket API
3 * 3 *
4 * Copyright (c) 2001-2007, Ericsson AB 4 * Copyright (c) 2001-2007, Ericsson AB
5 * Copyright (c) 2004-2007, Wind River Systems 5 * Copyright (c) 2004-2008, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -189,7 +189,6 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
189 socket_state state; 189 socket_state state;
190 struct sock *sk; 190 struct sock *sk;
191 struct tipc_port *tp_ptr; 191 struct tipc_port *tp_ptr;
192 u32 portref;
193 192
194 /* Validate arguments */ 193 /* Validate arguments */
195 194
@@ -225,9 +224,9 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
225 224
226 /* Allocate TIPC port for socket to use */ 225 /* Allocate TIPC port for socket to use */
227 226
228 portref = tipc_createport_raw(sk, &dispatch, &wakeupdispatch, 227 tp_ptr = tipc_createport_raw(sk, &dispatch, &wakeupdispatch,
229 TIPC_LOW_IMPORTANCE, &tp_ptr); 228 TIPC_LOW_IMPORTANCE);
230 if (unlikely(portref == 0)) { 229 if (unlikely(!tp_ptr)) {
231 sk_free(sk); 230 sk_free(sk);
232 return -ENOMEM; 231 return -ENOMEM;
233 } 232 }
@@ -240,14 +239,14 @@ static int tipc_create(struct net *net, struct socket *sock, int protocol)
240 sock_init_data(sock, sk); 239 sock_init_data(sock, sk);
241 sk->sk_rcvtimeo = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT); 240 sk->sk_rcvtimeo = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT);
242 sk->sk_backlog_rcv = backlog_rcv; 241 sk->sk_backlog_rcv = backlog_rcv;
243 tipc_sk(sk)->p = tipc_get_port(portref); 242 tipc_sk(sk)->p = tp_ptr;
244 243
245 spin_unlock_bh(tp_ptr->lock); 244 spin_unlock_bh(tp_ptr->lock);
246 245
247 if (sock->state == SS_READY) { 246 if (sock->state == SS_READY) {
248 tipc_set_portunreturnable(portref, 1); 247 tipc_set_portunreturnable(tp_ptr->ref, 1);
249 if (sock->type == SOCK_DGRAM) 248 if (sock->type == SOCK_DGRAM)
250 tipc_set_portunreliable(portref, 1); 249 tipc_set_portunreliable(tp_ptr->ref, 1);
251 } 250 }
252 251
253 atomic_inc(&tipc_user_count); 252 atomic_inc(&tipc_user_count);