Skip to content

Commit

Permalink
tipc: unconditionally put sock refcnt when sock timer to be deleted i…
Browse files Browse the repository at this point in the history
…s 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>
  • Loading branch information
Ying Xue authored and David S. Miller committed May 31, 2015
1 parent f4fb874 commit 1ea23a2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/tipc/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static int tipc_release(struct socket *sock)
struct net *net;
struct tipc_sock *tsk;
struct sk_buff *skb;
u32 dnode, probing_state;
u32 dnode;

/*
* Exit if socket isn't fully initialized (occurs when a failed accept()
Expand Down Expand Up @@ -448,10 +448,7 @@ static int tipc_release(struct socket *sock)
}

tipc_sk_withdraw(tsk, 0, NULL);
probing_state = tsk->probing_state;
if (del_timer_sync(&sk->sk_timer) &&
probing_state != TIPC_CONN_PROBING)
sock_put(sk);
sk_stop_timer(sk, &sk->sk_timer);
tipc_sk_remove(tsk);
if (tsk->connected) {
skb = tipc_msg_create(TIPC_CRITICAL_IMPORTANCE,
Expand Down

0 comments on commit 1ea23a2

Please sign in to comment.