iscsi-target: Re-add chunk from backport of upstream 79d59d08082d to 3.10
authorRoland Dreier <roland@purestorage.com>
Mon, 30 Jun 2014 14:02:20 +0000 (07:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:09:47 +0000 (20:09 -0700)
Commit d5c55fa31a29, the backport of upstream 79d59d08082d
("iscsi-target: Fix wrong buffer / buffer overrun in
iscsi_change_param_value()") left out applying one chunk of the fix in
iscsi_login_non_zero_tsih_s2().  Add the missing chunk.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/iscsi_target_login.c

index 0d6c3dd25679b9da390e54706816452c7a053369..e14e105acff8f8bd1d7b5498621ab644a817b2b9 100644 (file)
@@ -597,13 +597,8 @@ static int iscsi_login_non_zero_tsih_s2(
         *
         * In our case, we have already located the struct iscsi_tiqn at this point.
         */
-       memset(buf, 0, 32);
-       sprintf(buf, "TargetPortalGroupTag=%hu", ISCSI_TPG_S(sess)->tpgt);
-       if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) {
-               iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
-                               ISCSI_LOGIN_STATUS_NO_RESOURCES);
+       if (iscsi_change_param_sprintf(conn, "TargetPortalGroupTag=%hu", sess->tpg->tpgt))
                return -1;
-       }
 
        return iscsi_login_disable_FIM_keys(conn->param_list, conn);
 }