Removed unneccessary sock_hold from sdp_shutdown. This ref count
will be taken by close(). no need to take it twice.
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
if (!(how & SEND_SHUTDOWN))
return;
+ /* If we've already sent a FIN, or it's a closed state, skip this. */
+ if (!((1 << sk->sk_state) &
+ (TCPF_ESTABLISHED | TCPF_SYN_SENT |
+ TCPF_SYN_RECV | TCPF_CLOSE_WAIT))) {
+ return;
+ }
+
if (!sdp_close_state(sk))
return;
- sock_hold(sk, SOCK_REF_CM_TW);
-
/*
* Just turn off CORK here.
* We could check for socket shutting down in main data path,