forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/drivers/target/iscsi/iscsi_target_stat.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*******************************************************************************
23 * Modern ConfigFS group context specific iSCSI statistics based on original
34 * iscsi_target_mib.c code
....@@ -6,15 +7,6 @@
67 *
78 * Author: Nicholas A. Bellinger <nab@linux-iscsi.org>
89 *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
1810 ******************************************************************************/
1911
2012 #include <linux/configfs.h>
....@@ -328,10 +320,10 @@
328320 {
329321 struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item);
330322 struct iscsi_login_stats *lstat = &tiqn->login_stats;
331
- unsigned char buf[224];
323
+ unsigned char buf[ISCSI_IQN_LEN];
332324
333325 spin_lock(&lstat->lock);
334
- snprintf(buf, 224, "%s", lstat->last_intr_fail_name[0] ?
326
+ snprintf(buf, ISCSI_IQN_LEN, "%s", lstat->last_intr_fail_name[0] ?
335327 lstat->last_intr_fail_name : NONE);
336328 spin_unlock(&lstat->lock);
337329