diff options
author | Alexander Motin <mav@FreeBSD.org> | 2021-03-02 21:07:22 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2021-03-15 02:35:47 +0000 |
commit | fb419e0ffb282ea79c28621769ade3f85424bfaa (patch) | |
tree | d38f7b777af2e413c15795f65fbebce7707fec22 | |
parent | 6b409a8b32e056e2a5d7b886ce4210bba81a019a (diff) |
Fix initiator panic after 6895f89fe54e.
There are sessions without socket that are not disconnecting yet.
MFC after: 3 weeks
(cherry picked from commit 06e9c710998b83a3be21f7f264187fff5d590bc3)
-rw-r--r-- | sys/dev/iscsi/icl_soft.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index c66d8ccdb5fd..c64f0cfde71b 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -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); |