]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: fix for socket refcnt when error is marked while in TCP_TIME_WAIT state
authorEldad Zinger <eldadz@mellanox.co.il>
Tue, 20 Jul 2010 11:32:44 +0000 (14:32 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:12 +0000 (05:05 -0700)
When socket is in TCP_TIME_WAIT state, the next sdp_destroy_work() call will
put the cma_refcnt, so we should not change the socket state even if there is
an error.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp.h

index 8ab07cd12ee332457ce696d87a08c055e5d26b9d..9d1d661344c45b7b0ad2c8e2072a2d3d7c2b6a75 100644 (file)
@@ -520,7 +520,7 @@ static inline void sdp_set_error(struct sock *sk, int err)
 
        if ((1 << sk->sk_state) & ib_teardown_states)
                sdp_exch_state(sk, ib_teardown_states, TCP_TIME_WAIT);
-       else
+       else if (TCP_TIME_WAIT != sk->sk_state)
                sdp_exch_state(sk, ~0, TCP_CLOSE);
 
        sk->sk_error_report(sk);