All of lore.kernel.org
 help / color / mirror / Atom feed
* re: fnic: Using rport->dd_data to check rport online instead of rport_lookup.
@ 2016-04-01 19:44 Dan Carpenter
  2016-04-12  1:53 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-04-01 19:44 UTC (permalink / raw)
  To: satishkh; +Cc: linux-scsi

Hello Satish Kharat,

This is a semi-automatic email about new static checker warnings.

The patch ce4b9e8980fa: "fnic: Using rport->dd_data to check rport 
online instead of rport_lookup." from Mar 18, 2016, leads to the 
following Smatch complaint:

drivers/scsi/fnic/fnic_scsi.c:457 fnic_queuecommand_lck()
	 warn: variable dereferenced before check 'rport' (see line 449)

drivers/scsi/fnic/fnic_scsi.c
   448		rport = starget_to_rport(scsi_target(sc->device));
   449		ret = fc_remote_port_chkready(rport);
                                              ^^^^^
Old dereference (inside function call).

   450		if (ret) {
   451			atomic64_inc(&fnic_stats->misc_stats.rport_not_ready);
   452			sc->result = ret;
   453			done(sc);
   454			return 0;
   455		}
   456	
   457		if (rport) {
                    ^^^^^
The patch adds a check but too late.  Probably just delete the check?

   458			struct fc_rport_libfc_priv *rp = rport->dd_data;
   459	

regards,
dan carpenter

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

* Re: fnic: Using rport->dd_data to check rport online instead of rport_lookup.
  2016-04-01 19:44 fnic: Using rport->dd_data to check rport online instead of rport_lookup Dan Carpenter
@ 2016-04-12  1:53 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2016-04-12  1:53 UTC (permalink / raw)
  To: satishkh; +Cc: Dan Carpenter, linux-scsi

>>>>> "Dan" == Dan Carpenter <dan.carpenter@oracle.com> writes:

Dan> The patch ce4b9e8980fa: "fnic: Using rport->dd_data to check rport
Dan> online instead of rport_lookup." from Mar 18, 2016, leads to the
Dan> following Smatch complaint:

Dan> drivers/scsi/fnic/fnic_scsi.c:457 fnic_queuecommand_lck() warn:
Dan> variable dereferenced before check 'rport' (see line 449)

Satish?

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2016-04-12  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01 19:44 fnic: Using rport->dd_data to check rport online instead of rport_lookup Dan Carpenter
2016-04-12  1:53 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.