Commit a3793969 authored by Lance Hartmann's avatar Lance Hartmann Committed by Jim Harris
Browse files

iscsi: Handle spdk_get_pdu() failure in spdk_iscsi_op_text()



Prepares spdk_iscsi_op_text() to handle the case where
spdk_get_pdu() will return NULL in a future patch instead
of abort()'ing.

Change-Id: I21036116936c50c5674e0d11bbb4a30938bf5336
Signed-off-by: default avatarLance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/403860


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent cb7661cd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2394,6 +2394,7 @@ spdk_iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
	} else {
		if (spdk_iscsi_param_eq_val(conn->sess->params,
					    "SessionType", "Discovery")) {
			spdk_iscsi_param_free(*params_p);
			free(data);
			return SPDK_ISCSI_CONNECTION_FATAL;
		}
@@ -2403,6 +2404,11 @@ spdk_iscsi_op_text(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)

	/* response PDU */
	rsp_pdu = spdk_get_pdu();
	if (rsp_pdu == NULL) {
		spdk_iscsi_param_free(*params_p);
		free(data);
		return SPDK_ISCSI_CONNECTION_FATAL;
	}
	rsph = (struct iscsi_bhs_text_resp *)&rsp_pdu->bhs;

	rsp_pdu->data = data;