From f6e7137e7277ccf36c24ce34e9c9e51288af60ba Mon Sep 17 00:00:00 2001 From: Lance Hartmann Date: Tue, 13 Mar 2018 18:53:58 -0400 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/403745 Tested-by: SPDK Automated Test System Reviewed-by: Shuhei Matsumoto Reviewed-by: Daniel Verkamp Reviewed-by: Jim Harris --- lib/iscsi/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 999667e4a..db4ed9366 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -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;