linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] bfa: dereferencing before testing
@ 2010-08-07 22:13 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-08-07 22:13 UTC (permalink / raw)
  To: Jing Huang
  Cc: James E.J. Bottomley, Krishna Gudipati, linux-scsi, linux-kernel,
	kernel-janitors

I moved the dereference of "port" after the check to verify it was
non-NULL.

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

diff --git a/drivers/scsi/bfa/lport_api.c b/drivers/scsi/bfa/lport_api.c
index 72b3f50..5cd356a 100644
--- a/drivers/scsi/bfa/lport_api.c
+++ b/drivers/scsi/bfa/lport_api.c
@@ -149,11 +149,12 @@ bfa_fcs_port_get_rport_max_speed(struct bfa_fcs_port_s *port)
 	enum bfa_pport_speed max_speed = 0;
 	struct bfa_pport_attr_s pport_attr;
 	enum bfa_pport_speed pport_speed, rport_speed;
-	bfa_boolean_t     trl_enabled = bfa_fcport_is_ratelim(port->fcs->bfa);
+	bfa_boolean_t trl_enabled;
 
 	if (port == NULL)
 		return 0;
 
+	trl_enabled = bfa_fcport_is_ratelim(port->fcs->bfa);
 	fcs = port->fcs;
 
 	/*

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-07 22:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-07 22:13 [patch] bfa: dereferencing before testing Dan Carpenter

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