Commit dfe5d837 authored by Jim Harris's avatar Jim Harris
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I352a2aa513541ba630ace368137433e509700e32
parent 7faf9554
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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_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;
		pthread_mutex_lock(&target->mutex);
		target->num_active_conns--;