From 71f63bb7d957e69023a098e4c9d86c70583b051c Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Thu, 31 Oct 2019 14:27:22 +0900 Subject: [PATCH] lib/iscsi: Embed _iscsi_conn_free() into the caller and free it _iscsi_conn_free() is simple enough to embed it into the caller and remove it. Signed-off-by: Shuhei Matsumoto Change-Id: I22bcbbdab15eca647914715754c04b8ec14ad9b2 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472901 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- lib/iscsi/conn.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index ffdfcf18b..b3687a608 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -368,18 +368,6 @@ iscsi_conn_free_tasks(struct spdk_iscsi_conn *conn) return 0; } -static void -_iscsi_conn_free(struct spdk_iscsi_conn *conn) -{ - if (conn == NULL) { - return; - } - - spdk_iscsi_param_free(conn->params); - - free_conn(conn); -} - static void iscsi_conn_cleanup_backend(struct spdk_iscsi_conn *conn) { @@ -446,7 +434,8 @@ iscsi_conn_free(struct spdk_iscsi_conn *conn) end: SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "cleanup free conn\n"); - _iscsi_conn_free(conn); + spdk_iscsi_param_free(conn->params); + free_conn(conn); pthread_mutex_unlock(&g_conns_mutex); }