summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2015-01-22 12:20:40 +0100
committerChristoph Hellwig <hch@lst.de>2015-01-22 17:50:52 +0100
commit6d310dfb382a303cbaf838e1b680f55cef18ae03 (patch)
tree2c4ad24491b50fc5ed5737cb5cce46ac5a754d79 /drivers/scsi/scsi_debug.c
parentscsi: Avoid crashing if device uses DIX but adapter does not support it (diff)
downloadlinux-6d310dfb382a303cbaf838e1b680f55cef18ae03.tar.xz
linux-6d310dfb382a303cbaf838e1b680f55cef18ae03.zip
scsi_debug: test always evaluates to false, || should be used instead
cppcheck found the following issue: (warning) Logical conjunction always evaluates to false: alloc_len < 4 && alloc_len > 65535. ..the test should be instead: if (alloc_len < 4 || alloc_len > 65536) This error was introduced by recent commit 38d5c8336e60bf6e53a1da9 ("scsi_debug: add Report supported opcodes+tmfs; Compare and write") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 9a74f425db93..4aca1b0378c2 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -1623,7 +1623,7 @@ resp_rsup_opcodes(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
req_opcode = cmd[3];
req_sa = get_unaligned_be16(cmd + 4);
alloc_len = get_unaligned_be32(cmd + 6);
- if (alloc_len < 4 && alloc_len > 0xffff) {
+ if (alloc_len < 4 || alloc_len > 0xffff) {
mk_sense_invalid_fld(scp, SDEB_IN_CDB, 6, -1);
return check_condition_result;
}