Commit e199f1a5 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

lib/iscsi: adjust the location of spdk_iscsi_param_free in two functions.



Purpose: To prepare for the further patch submission.
Since we do not need to keep this variable too late.

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: Ibaa100925e1ea317253d4fe7e560917e063fcf6b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/482290


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent d8d1168c
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -1134,6 +1134,8 @@ iscsi_op_login_response(struct spdk_iscsi_conn *conn,
		rsph->flags &= ~ISCSI_LOGIN_CURRENT_STAGE_MASK;
		rsph->flags &= ~ISCSI_LOGIN_NEXT_STAGE_MASK;
	}

	spdk_iscsi_param_free(params);
	spdk_iscsi_conn_write_pdu(conn, rsp_pdu, spdk_iscsi_conn_pdu_generic_complete, NULL);

	/* after send PDU digest on/off */
@@ -1142,19 +1144,16 @@ iscsi_op_login_response(struct spdk_iscsi_conn *conn,
		rc = spdk_iscsi_copy_param2var(conn);
		if (rc < 0) {
			SPDK_ERRLOG("spdk_iscsi_copy_param2var() failed\n");
			spdk_iscsi_param_free(params);
			return -1;
		}
		/* check value */
		rc = iscsi_check_values(conn);
		if (rc < 0) {
			SPDK_ERRLOG("iscsi_check_values() failed\n");
			spdk_iscsi_param_free(params);
			return -1;
		}
	}

	spdk_iscsi_param_free(params);
	return 0;
}

@@ -2373,12 +2372,12 @@ iscsi_pdu_payload_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p
		}
	}

	spdk_iscsi_param_free(params);
	SPDK_LOGDUMP(SPDK_LOG_ISCSI, "Negotiated Params", data, data_len);

	/* response PDU */
	rsp_pdu = spdk_get_pdu(conn);
	if (rsp_pdu == NULL) {
		spdk_iscsi_param_free(params);
		free(data);
		return SPDK_ISCSI_CONNECTION_FATAL;
	}
@@ -2422,7 +2421,6 @@ iscsi_pdu_payload_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p
	rc = spdk_iscsi_copy_param2var(conn);
	if (rc < 0) {
		SPDK_ERRLOG("spdk_iscsi_copy_param2var() failed\n");
		spdk_iscsi_param_free(params);
		return -1;
	}

@@ -2430,11 +2428,9 @@ iscsi_pdu_payload_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *p
	rc = iscsi_check_values(conn);
	if (rc < 0) {
		SPDK_ERRLOG("iscsi_check_values() failed\n");
		spdk_iscsi_param_free(params);
		return -1;
	}

	spdk_iscsi_param_free(params);
	return 0;
}