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 <lorneli@163.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I62f7a4bd301c5a74ad6ba10b1b448189f750b324
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458339
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Lorne Li <lorneli@163.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-06-18 13:54:07 +09:00 committed by Changpeng Liu
parent 94f67dd5ae
commit d1a96e7cde

View File

@ -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,
&param, &target, 0);
CU_ASSERT(conn.target_port == NULL);