linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: linux-driver@qlogic.com,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	Giridhar Malavali <giridhar.malavali@qlogic.com>,
	Harish Zunjarrao <harish.zunjarrao@qlogic.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] scsi/qla2xxx: fix end of loop test
Date: Sat, 22 May 2010 22:37:48 +0200	[thread overview]
Message-ID: <20100522203748.GT22515@bicker> (raw)

The "fcport" variable is never null here.  I've updated the condition to
test for the end of the list_for_each_entry() loop.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index b905dfe..14ca275 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -1050,7 +1050,7 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
 		break;
 	}
 
-	if (!fcport) {
+	if (&fcport->list == &vha->vp_fcports) {
 		DEBUG2(printk(KERN_ERR "%s(%ld): Failed to find port\n",
 			__func__, vha->host_no));
 		return -EINVAL;

                 reply	other threads:[~2010-05-22 20:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100522203748.GT22515@bicker \
    --to=error27@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=andrew.vasquez@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=harish.zunjarrao@qlogic.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-driver@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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).