From: Xi Wang <xi.wang@gmail.com>
To: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Xi Wang <xi.wang@gmail.com>
Subject: [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf()
Date: Mon, 5 Nov 2012 01:15:53 -0500 [thread overview]
Message-ID: <1352096153-18211-1-git-send-email-xi.wang@gmail.com> (raw)
The dereference rport->data should come after the NULL check of rport.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
drivers/scsi/bnx2fc/bnx2fc_io.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 8d4626c..eebe93c 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -686,7 +686,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
{
struct fc_lport *lport;
struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
- struct fc_rport_libfc_priv *rp = rport->dd_data;
+ struct fc_rport_libfc_priv *rp;
struct fcoe_port *port;
struct bnx2fc_interface *interface;
struct bnx2fc_rport *tgt;
@@ -712,6 +712,7 @@ static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
rc = FAILED;
goto tmf_err;
}
+ rp = rport->dd_data;
rc = fc_block_scsi_eh(sc_cmd);
if (rc)
--
1.7.10.4
next reply other threads:[~2012-11-05 6:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-05 6:15 Xi Wang [this message]
2012-11-05 21:35 ` [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf() Bhanu Prakash Gollapudi
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=1352096153-18211-1-git-send-email-xi.wang@gmail.com \
--to=xi.wang@gmail.com \
--cc=JBottomley@parallels.com \
--cc=bprakash@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--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