From f2f96d20708c53c6825f842beb7bed06f5f15aca Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 25 Feb 2011 15:03:23 -0800 Subject: [PATCH] [SCSI] fcoe: precedence bug in fcoe_filter_frames() Negate has higher precedence than bitwise AND. FCPHF_CRC_UNCHECKED is 0x1 so the original code is equivalent to: if (!fr_flags(fp)) { ... Signed-off-by: Dan Carpenter Signed-off-by: Robert Love Signed-off-by: James Bottomley --- drivers/scsi/fcoe/fcoe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 0b5fbb8940c4..0b44d057ccc3 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c @@ -1548,7 +1548,7 @@ static inline int fcoe_filter_frames(struct fc_lport *lport, return -EINVAL; } - if (!fr_flags(fp) & FCPHF_CRC_UNCHECKED || + if (!(fr_flags(fp) & FCPHF_CRC_UNCHECKED) || le32_to_cpu(fr_crc(fp)) == ~crc32(~0, skb->data, skb->len)) { fr_flags(fp) &= ~FCPHF_CRC_UNCHECKED; return 0; -- 2.39.5