kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()
@ 2020-06-19 14:30 Dan Carpenter
  2020-06-24 17:59 ` Shyam Sundar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-06-19 14:30 UTC (permalink / raw)
  To: Nilesh Javali, Darren Trapp
  Cc: GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, Himanshu Madhani, Johannes Thumshirn,
	Hannes Reinecke, linux-scsi, kernel-janitors

This code doesn't make sense unless the correct "fcport" was found.

Fixes: 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is from static analysis and review.  I'm not super familiar with
the code and I can't test it.  Please review it extra carefully.

 drivers/scsi/qla2xxx/qla_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4576d3ae9937..2436a17f5cd9 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -5944,7 +5944,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
 			break;
 		}
 
-		if (NVME_TARGET(vha->hw, fcport)) {
+		if (found && NVME_TARGET(vha->hw, fcport)) {
 			if (fcport->disc_state = DSC_DELETE_PEND) {
 				qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
 				vha->fcport_count--;
-- 
2.27.0

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

end of thread, other threads:[~2020-06-27  3:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 14:30 [PATCH] scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs() Dan Carpenter
2020-06-24 17:59 ` Shyam Sundar
2020-06-25 14:11 ` Himanshu Madhani
2020-06-27  3:09 ` Martin K. Petersen

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