linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf()
@ 2012-11-05  6:15 Xi Wang
  2012-11-05 21:35 ` Bhanu Prakash Gollapudi
  0 siblings, 1 reply; 2+ messages in thread
From: Xi Wang @ 2012-11-05  6:15 UTC (permalink / raw)
  To: Bhanu Prakash Gollapudi
  Cc: James E.J. Bottomley, linux-scsi, linux-kernel, Xi Wang

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf()
  2012-11-05  6:15 [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf() Xi Wang
@ 2012-11-05 21:35 ` Bhanu Prakash Gollapudi
  0 siblings, 0 replies; 2+ messages in thread
From: Bhanu Prakash Gollapudi @ 2012-11-05 21:35 UTC (permalink / raw)
  To: Xi Wang; +Cc: James E.J. Bottomley, linux-scsi, linux-kernel

On 11/04/2012 10:15 PM, Xi Wang wrote:
> 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)
I thought I acked similar patch sometime back, but this did not make it 
to the tree yet.

doing it again. Thanks!

Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-05 21:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05  6:15 [PATCH] [SCSI] bnx2fc: fix NULL checking in bnx2fc_initiate_tmf() Xi Wang
2012-11-05 21:35 ` Bhanu Prakash Gollapudi

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).