linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: James.Bottomley@suse.de, linux-scsi@vger.kernel.org
Cc: Dan Carpenter <error27@gmail.com>
Subject: [PATCH 7/8] fcoe: precedence bug in fcoe_filter_frames()
Date: Fri, 25 Feb 2011 15:03:23 -0800	[thread overview]
Message-ID: <20110225230323.9310.23224.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20110225230245.9310.81462.stgit@localhost6.localdomain6>

From: Dan Carpenter <error27@gmail.com>

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>
---
 drivers/scsi/fcoe/fcoe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 0b5fbb8..0b44d05 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;


  parent reply	other threads:[~2011-02-25 23:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 23:02 [PATCH 0/8] libfc, libfcoe and fcoe updates for scsi-misc Robert Love
2011-02-25 23:02 ` [PATCH 1/8] libfc: Fixing a memory leak when destroying an interface Robert Love
2011-02-25 23:02 ` [PATCH 2/8] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out" Robert Love
2011-02-25 23:03 ` [PATCH 3/8] fcoe, libfc: initialize EM anchors list and then update npiv EMs Robert Love
2011-02-25 23:03 ` [PATCH 4/8] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument Robert Love
2011-02-25 23:03 ` [PATCH 5/8] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h Robert Love
2011-02-25 23:03 ` [PATCH 6/8] libfcoe: Remove stale fcoe-netdev entries Robert Love
2011-02-25 23:03 ` Robert Love [this message]
2011-02-25 23:03 ` [PATCH 8/8] fcoe: fix broken fcoe interface reset Robert Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110225230323.9310.23224.stgit@localhost6.localdomain6 \
    --to=robert.w.love@intel.com \
    --cc=James.Bottomley@suse.de \
    --cc=error27@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).