lib: Handle spdk_get_pdu() failure in spdk_iscsi_read_pdu()

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

Change-Id: I9ccfbf41821fb90a203fd8ad026f42fac10e9dbc
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/403745
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Lance Hartmann 2018-03-13 18:53:58 -04:00 committed by Jim Harris
parent 372c5e1ec7
commit f6e7137e72

View File

@ -362,6 +362,9 @@ spdk_iscsi_read_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu **_pdu)
if (conn->pdu_in_progress == NULL) {
conn->pdu_in_progress = spdk_get_pdu();
if (conn->pdu_in_progress == NULL) {
return SPDK_ISCSI_CONNECTION_FATAL;
}
}
pdu = conn->pdu_in_progress;