From 7a17d4e249d15cb5adbf86ecbb95dc52a17aa55b Mon Sep 17 00:00:00 2001 From: Cunyin Chang Date: Wed, 23 Nov 2016 11:01:12 +0800 Subject: [PATCH] iscsi: Check the connection state in function spdk_iscsi_conn_execute(). This patch make sure the connection in normal state before any further operation on this connection. Change-Id: I776740b5b33b1de6707990c09d9131c385adf556 Signed-off-by: Cunyin Chang --- lib/iscsi/conn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index fb33f457b..36dfe5fd5 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -1233,6 +1233,9 @@ spdk_iscsi_conn_execute(struct spdk_iscsi_conn *conn) uint64_t tsc; bool conn_active = false; + if (conn->state == ISCSI_CONN_STATE_EXITING) { + return -1; + } /* Check for nop interval expiration */ rc = spdk_iscsi_conn_handle_nop(conn); if (rc < 0) {