linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <vikas.chaudhary@qlogic.com>
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
	giridhar.malavali@qlogic.com,
	Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Subject: [PATCH 4/6] qla4xxx: Fix smatch warning in func qla4xxx_get_ep_param
Date: Wed, 9 Apr 2014 21:12:27 -0400	[thread overview]
Message-ID: <1397092349-25332-5-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1397092349-25332-1-git-send-email-vikas.chaudhary@qlogic.com>

From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>

Fix following smatch warning:-
 drivers/scsi/qla4xxx/ql4_os.c:1752 qla4xxx_get_ep_param() warn: variable dereferenced before check 'qla_ep' (see line 1745)

Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
 drivers/scsi/qla4xxx/ql4_os.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 9be829b..592f293 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -1742,6 +1742,9 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep,
 	struct sockaddr *dst_addr;
 	struct scsi_qla_host *ha;
 
+	if (!qla_ep)
+		return -ENOTCONN;
+
 	ha = to_qla_host(qla_ep->host);
 	DEBUG2(ql4_printk(KERN_INFO, ha, "%s: host: %ld\n", __func__,
 			  ha->host_no));
@@ -1749,9 +1752,6 @@ static int qla4xxx_get_ep_param(struct iscsi_endpoint *ep,
 	switch (param) {
 	case ISCSI_PARAM_CONN_PORT:
 	case ISCSI_PARAM_CONN_ADDRESS:
-		if (!qla_ep)
-			return -ENOTCONN;
-
 		dst_addr = (struct sockaddr *)&qla_ep->dst_addr;
 		if (!dst_addr)
 			return -ENOTCONN;
-- 
1.8.2.GIT


  parent reply	other threads:[~2014-04-10  1:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  1:12 [PATCH 0/6] qla4xxx: 5.04.00-k6: Updates for scsi "misc" branch vikas.chaudhary
2014-04-10  1:12 ` [PATCH 1/6] qla4xxx: Disable INTx interrupt for ISP82XX vikas.chaudhary
2014-04-10  1:12 ` [PATCH 2/6] qla4xxx: Export sysfs DDBs from DPC handler vikas.chaudhary
2014-04-10  1:12 ` [PATCH 3/6] qla4xxx: Fix memory leak for ha->saved_acb vikas.chaudhary
2014-04-10  1:12 ` vikas.chaudhary [this message]
2014-04-10  1:12 ` [PATCH 5/6] qla4xxx: Fix smatch warning in func qla4xxx_conn_get_param vikas.chaudhary
2014-04-10  1:12 ` [PATCH 6/6] qla4xxx: Update driver version to 5.04.00-k6 vikas.chaudhary
2014-04-11 17:31 ` [PATCH 0/6] qla4xxx: 5.04.00-k6: Updates for scsi "misc" branch Mike Christie

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=1397092349-25332-5-git-send-email-vikas.chaudhary@qlogic.com \
    --to=vikas.chaudhary@qlogic.com \
    --cc=adheer.chandravanshi@qlogic.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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).