From: Eldad Zinger Date: Tue, 20 Jul 2010 11:32:44 +0000 (+0300) Subject: sdp: fix for socket refcnt when error is marked while in TCP_TIME_WAIT state X-Git-Tag: v4.1.12-92~264^2~5^2~137 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2c02fbb85ada22f2a620e1b9cd30ffc5fc345ef5;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index 8ab07cd12ee33..9d1d661344c45 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);