From d1a96e7cde77f1ba476ef3a96feb720f9a572251 Mon Sep 17 00:00:00 2001 From: Shuhei Matsumoto Date: Tue, 18 Jun 2019 13:54:07 +0900 Subject: [PATCH] iscsi: Fix UT failure due to uninitialized value detected by valgrind In a test case of op_login_session_normal_test(), it is expected that the tag of the session has any value different from the connection but the tag of the session was not initialized. Fixes #826 Reported-by: lorneli Signed-off-by: Shuhei Matsumoto Change-Id: I62f7a4bd301c5a74ad6ba10b1b448189f750b324 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458339 Tested-by: SPDK CI Jenkins Reviewed-by: Lorne Li Reviewed-by: Changpeng Liu --- test/unit/lib/iscsi/iscsi.c/iscsi_ut.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c b/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c index 555128b7b..372a04019 100644 --- a/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c +++ b/test/unit/lib/iscsi/iscsi.c/iscsi_ut.c @@ -220,6 +220,7 @@ op_login_session_normal_test(void) g_spdk_iscsi.session[UT_ISCSI_TSIH - 1] = &sess; sess.tsih = UT_ISCSI_TSIH; rsph->tsih = UT_ISCSI_TSIH >> 8; /* to append the session */ + sess.tag = 1; rc = iscsi_op_login_session_normal(&conn, &rsp_pdu, UT_INITIATOR_NAME1, ¶m, &target, 0); CU_ASSERT(conn.target_port == NULL);