diff --git a/scst/README b/scst/README index 86e7cae1c..ecf50ef6a 100644 --- a/scst/README +++ b/scst/README @@ -486,4 +486,6 @@ Thanks to: * Calvin Morrow for testing and usful suggestions. + * Erik Habbinga for fixes. + Vladislav Bolkhovitin , http://scst.sourceforge.net diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 6cdbff8df..0e5c416fd 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -3861,11 +3861,13 @@ restart: list_for_each_entry(sess, &scst_sess_mgmt_list, sess_mgmt_list_entry) { + int shutting_down; TRACE_DBG("Removing sess %p from scst_sess_mgmt_list", sess); list_del(&sess->sess_mgmt_list_entry); + shutting_down = sess->shutting_down; spin_unlock_irq(&scst_mgmt_lock); - if (sess->shutting_down) { + if (shutting_down) { BUG_ON(atomic_read(&sess->refcnt) != 0); scst_free_session_callback(sess); } else if (sess->init_phase == SCST_SESS_IPH_INITING) {