From 2c02fbb85ada22f2a620e1b9cd30ffc5fc345ef5 Mon Sep 17 00:00:00 2001 From: Eldad Zinger Date: Tue, 20 Jul 2010 14:32:44 +0300 Subject: [PATCH] sdp: fix for socket refcnt when error is marked while in TCP_TIME_WAIT state 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 --- drivers/infiniband/ulp/sdp/sdp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index 8ab07cd12ee3..9d1d661344c4 100644 --- a/drivers/infiniband/ulp/sdp/sdp.h +++ b/drivers/infiniband/ulp/sdp/sdp.h @@ -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); -- 2.49.0