Commit cbe3fd39 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: qla2xxx: Fix an endian bug in fcpcmd_is_corrupted()

We should first do the le16_to_cpu endian conversion and then apply the
FCP_CMD_LENGTH_MASK mask.

Fixes: 5f35509d ("qla2xxx: Terminate exchange if corrupted")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarQuinn Tran <Quinn.Tran@cavium.com>
Acked-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 679fcae4
...@@ -374,7 +374,7 @@ struct atio_from_isp { ...@@ -374,7 +374,7 @@ struct atio_from_isp {
static inline int fcpcmd_is_corrupted(struct atio *atio) static inline int fcpcmd_is_corrupted(struct atio *atio)
{ {
if (atio->entry_type == ATIO_TYPE7 && if (atio->entry_type == ATIO_TYPE7 &&
(le16_to_cpu(atio->attr_n_length & FCP_CMD_LENGTH_MASK) < ((le16_to_cpu(atio->attr_n_length) & FCP_CMD_LENGTH_MASK) <
FCP_CMD_LENGTH_MIN)) FCP_CMD_LENGTH_MIN))
return 1; return 1;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment