in error flow, sdp_destroy_work is placed in workqueue and sometimes the
user application call close() that destruct the socket before sdp_destroy_work
is called.
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
sk->sk_state_change(sk);
+ /* Don't destroy socket before destroy work does its job */
+ sock_hold(sk);
queue_work(sdp_workqueue, &ssk->destroy_work);
read_unlock(&device_removal_lock);
but if a CM connection is dropped below our legs state could
be any state */
sdp_exch_state(sk, ~0, TCP_CLOSE);
+ sock_put(sk);
}
void sdp_dreq_wait_timeout_work(struct work_struct *work)