summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2014-02-03 09:35:03 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2014-02-13 00:11:04 +0100
commit6a16d7be932a9df1024836ccbb448de73afd3dd0 (patch)
tree14a6fdc34f180fc8311d1000b16f10aff10001e6 /drivers
parentqla2xxx: Remove last vestiges of qla_tgt_cmd.cmd_list (diff)
downloadlinux-6a16d7be932a9df1024836ccbb448de73afd3dd0.tar.xz
linux-6a16d7be932a9df1024836ccbb448de73afd3dd0.zip
target: Fix missing length check in spc_emulate_evpd_83()
Commit fbfe858fea2a ("target_core_spc: Include target device descriptor in VPD page 83") added a new length variable, but (due to a cut and paste mistake?) just checks scsi_name_len against 256 twice. Fix this to check scsi_target_len for overflow too. Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/target/target_core_spc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
index 43c5ca9878bc..3bebc71ea033 100644
--- a/drivers/target/target_core_spc.c
+++ b/drivers/target/target_core_spc.c
@@ -440,8 +440,8 @@ check_scsi_name:
padding = ((-scsi_target_len) & 3);
if (padding)
scsi_target_len += padding;
- if (scsi_name_len > 256)
- scsi_name_len = 256;
+ if (scsi_target_len > 256)
+ scsi_target_len = 256;
buf[off-1] = scsi_target_len;
off += scsi_target_len;