iscsi: ensure we have a conn->sess before trying to stop a poller
There are some error paths that can get to spdk_iscsi_conn_stop_poller() before the conn's session is set. So check whether the session is NULL before trying to check its session type. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I352a2aa513541ba630ace368137433e509700e32
This commit is contained in:
parent
7faf9554dd
commit
dfe5d83743
@ -678,7 +678,7 @@ spdk_iscsi_conn_stop_poller(struct spdk_iscsi_conn *conn, spdk_event_fn fn_after
|
|||||||
struct spdk_event *event;
|
struct spdk_event *event;
|
||||||
struct spdk_iscsi_tgt_node *target;
|
struct spdk_iscsi_tgt_node *target;
|
||||||
|
|
||||||
if (conn->sess->session_type == SESSION_TYPE_NORMAL) {
|
if (conn->sess != NULL && conn->sess->session_type == SESSION_TYPE_NORMAL) {
|
||||||
target = conn->sess->target;
|
target = conn->sess->target;
|
||||||
pthread_mutex_lock(&target->mutex);
|
pthread_mutex_lock(&target->mutex);
|
||||||
target->num_active_conns--;
|
target->num_active_conns--;
|
||||||
|
Loading…
Reference in New Issue
Block a user