mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
scsi: qla2xxx: Fix an endian bug in fcpcmd_is_corrupted()
[ Upstream commitcbe3fd39d2] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9ac4572a73
commit
a1d77f9cd1
@@ -374,8 +374,8 @@ struct atio_from_isp {
|
||||
static inline int fcpcmd_is_corrupted(struct atio *atio)
|
||||
{
|
||||
if (atio->entry_type == ATIO_TYPE7 &&
|
||||
(le16_to_cpu(atio->attr_n_length & FCP_CMD_LENGTH_MASK) <
|
||||
FCP_CMD_LENGTH_MIN))
|
||||
((le16_to_cpu(atio->attr_n_length) & FCP_CMD_LENGTH_MASK) <
|
||||
FCP_CMD_LENGTH_MIN))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user