public inbox for kernel-janitors@vger.kernel.org
 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>,
	Anirban Chakraborty <anirban.chakraborty@qlogic.com>,
	linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] scsi/qla2xxx: check for null consistently
Date: Sat, 22 May 2010 20:18:01 +0000	[thread overview]
Message-ID: <20100522201801.GK22515@bicker> (raw)

We assume that "ha->cs84xx" can be null on the previous line, so we
should check it here as well.

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

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 3b70860..ad22baa 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1211,7 +1211,7 @@ qla24xx_84xx_fw_version_show(struct device *dev,
 	if (ha->cs84xx && ha->cs84xx->op_fw_version = 0)
 		rval = qla84xx_verify_chip(vha, status);
 
-	if ((rval = QLA_SUCCESS) && (status[0] = 0))
+	if (ha->cs84xx && rval = QLA_SUCCESS && status[0] = 0)
 		return snprintf(buf, PAGE_SIZE, "%u\n",
 			(uint32_t)ha->cs84xx->op_fw_version);
 

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22 20:18 Dan Carpenter [this message]
2010-05-25 18:48 ` [patch] scsi/qla2xxx: check for null consistently Giridhar Malavali

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=20100522201801.GK22515@bicker \
    --to=error27@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=andrew.vasquez@qlogic.com \
    --cc=anirban.chakraborty@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-driver@qlogic.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