Index: head/sys/dev/iscsi/iscsi.c =================================================================== --- head/sys/dev/iscsi/iscsi.c +++ head/sys/dev/iscsi/iscsi.c @@ -434,6 +434,8 @@ sc = is->is_softc; sx_xlock(&sc->sc_lock); + TAILQ_REMOVE(&sc->sc_sessions, is, is_next); + sx_xunlock(&sc->sc_lock); icl_conn_close(is->is_conn); callout_drain(&is->is_callout); @@ -465,8 +467,6 @@ #ifdef ICL_KERNEL_PROXY cv_destroy(&is->is_login_cv); #endif - TAILQ_REMOVE(&sc->sc_sessions, is, is_next); - sx_xunlock(&sc->sc_lock); ISCSI_SESSION_DEBUG(is, "terminated"); free(is, M_ISCSI);