Skip to contentSkip to conversation

scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()

PATCH Applied Dan Carpenter 4 participants 4 messages Jun 19, 2020 – Jun 27, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: qla2xxx: Fix a condition in qla2x00_find_all_fabric_devs()

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

Fixes 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")

---
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(-)
drivers/scsi/qla2xxx/qla_init.c +1 -1
index 4576d3ae9937..2436a17f5cd9 100644
@@ -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--;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw

+1.

Quoted 29 lines · Dan Carpenter

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

Fixes 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")

---
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(-)
drivers/scsi/qla2xxx/qla_init.c +1 -1
index 4576d3ae9937..2436a17f5cd9 100644
@@ -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--;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter
Quoted 31 lines · Dan Carpenter

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

Fixes 9dd9686b1419 ("scsi: qla2xxx: Add changes for devloss timeout in driver")

---
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(-)
drivers/scsi/qla2xxx/qla_init.c +1 -1
index 4576d3ae9937..2436a17f5cd9 100644
@@ -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--;
Signature · 1 line
2.27.0

Looks Good.

--
Himanshu Madhani Oracle Linux Engineering