diff options
author | Ying Xue <ying.xue@windriver.com> | 2015-05-28 01:19:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-30 21:08:37 -0400 |
commit | 1ea23a21176e449685a9d0523ab6da83e3779eb1 (patch) | |
tree | 0e94b86cd5aff3b37351e0bb9ad203fa7d340bac /net/tipc/socket.c | |
parent | f4fb874cf076f9eafdd15c0a88cd0f0397b95e43 (diff) |
tipc: unconditionally put sock refcnt when sock timer to be deleted is pending
As sock refcnt is taken when sock timer is started in
sk_reset_timer(), the sock refcnt should be put when sock timer
to be deleted is in pending state no matter what "probing_state"
value of tipc sock is.
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 9370f953e16f..30ea82a9b0f1 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -410,7 +410,7 @@ static int tipc_release(struct socket *sock) | |||
410 | struct net *net; | 410 | struct net *net; |
411 | struct tipc_sock *tsk; | 411 | struct tipc_sock *tsk; |
412 | struct sk_buff *skb; | 412 | struct sk_buff *skb; |
413 | u32 dnode, probing_state; | 413 | u32 dnode; |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * Exit if socket isn't fully initialized (occurs when a failed accept() | 416 | * Exit if socket isn't fully initialized (occurs when a failed accept() |
@@ -448,10 +448,7 @@ static int tipc_release(struct socket *sock) | |||
448 | } | 448 | } |
449 | 449 | ||
450 | tipc_sk_withdraw(tsk, 0, NULL); | 450 | tipc_sk_withdraw(tsk, 0, NULL); |
451 | probing_state = tsk->probing_state; | 451 | sk_stop_timer(sk, &sk->sk_timer); |
452 | if (del_timer_sync(&sk->sk_timer) && | ||
453 | probing_state != TIPC_CONN_PROBING) | ||
454 | sock_put(sk); | ||
455 | tipc_sk_remove(tsk); | 452 | tipc_sk_remove(tsk); |
456 | if (tsk->connected) { | 453 | if (tsk->connected) { |
457 | skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, | 454 | skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE, |