Commit e8be2f64 authored by Ziye Yang's avatar Ziye Yang Committed by Daniel Verkamp
Browse files

nvmf: fix the error handling in spdk_nvmf_session_connect



We need to free the session resource, if there is error
for creating a new session

Change-Id: I7c4f3e779e0b30e213e02b8676d93bd2fe9bf851
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
parent bc0867dc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -264,6 +264,9 @@ spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn,
		session->max_connections_allowed = g_nvmf_tgt.max_queues_per_session;
		if (conn->transport->session_init(session, conn)) {
			rsp->status.sc = SPDK_NVME_SC_INTERNAL_DEVICE_ERROR;
			conn->transport->session_fini(session);
			free(session);
			subsystem->session = NULL;
			return;
		}