Fix initiator panic after 6895f89fe5.

There are sessions without socket that are not disconnecting yet.

MFC after:	3 weeks
This commit is contained in:
Alexander Motin 2021-03-02 16:07:22 -05:00
parent 907023b454
commit 06e9c71099

View file

@ -1364,9 +1364,11 @@ icl_soft_conn_close(struct icl_conn *ic)
ICL_CONN_LOCK(ic);
if (!ic->ic_disconnecting) {
so = ic->ic_socket;
SOCKBUF_LOCK(&so->so_rcv);
if (so)
SOCKBUF_LOCK(&so->so_rcv);
ic->ic_disconnecting = true;
SOCKBUF_UNLOCK(&so->so_rcv);
if (so)
SOCKBUF_UNLOCK(&so->so_rcv);
}
while (ic->ic_receive_running || ic->ic_send_running) {
cv_signal(&ic->ic_receive_cv);