[SCSI] fcoe: precedence bug in fcoe_filter_frames()
authorDan Carpenter <error27@gmail.com>
Fri, 25 Feb 2011 23:03:23 +0000 (15:03 -0800)
committerJames Bottomley <James.Bottomley@suse.de>
Tue, 1 Mar 2011 00:34:03 +0000 (18:34 -0600)
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 <error27@gmail.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/fcoe/fcoe.c

index 0b5fbb8940c41221ac64b9e7ca07cdab41feba63..0b44d057ccc3eb7a49893a38824dffb2f48a9e20 100644 (file)
@@ -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;