mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
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: 5f35509db1
("qla2xxx: Terminate exchange if corrupted")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Quinn Tran <Quinn.Tran@cavium.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
679fcae46c
commit
cbe3fd39d2
1 changed files with 2 additions and 2 deletions
|
@ -374,8 +374,8 @@ 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
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue