hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/target/iscsi/iscsi_target_nego.c
....@@ -1079,6 +1079,7 @@
10791079 iscsi_target_set_sock_callbacks(conn);
10801080
10811081 login->np = np;
1082
+ conn->tpg = NULL;
10821083
10831084 login_req = (struct iscsi_login_req *) login->req;
10841085 payload_length = ntoh24(login_req->dlength);
....@@ -1148,7 +1149,6 @@
11481149 */
11491150 sessiontype = strncmp(s_buf, DISCOVERY, 9);
11501151 if (!sessiontype) {
1151
- conn->tpg = iscsit_global->discovery_tpg;
11521152 if (!login->leading_connection)
11531153 goto get_target;
11541154
....@@ -1165,9 +1165,11 @@
11651165 * Serialize access across the discovery struct iscsi_portal_group to
11661166 * process login attempt.
11671167 */
1168
+ conn->tpg = iscsit_global->discovery_tpg;
11681169 if (iscsit_access_np(np, conn->tpg) < 0) {
11691170 iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
11701171 ISCSI_LOGIN_STATUS_SVC_UNAVAILABLE);
1172
+ conn->tpg = NULL;
11711173 ret = -1;
11721174 goto out;
11731175 }