Skip to contentSkip to conversation

scsi/qla2xxx: fix end of loop test

PATCH New Dan Carpenter 1 participant 1 message May 22, 2010

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

PATCH 1/1 scsi/qla2xxx: fix end of loop test

The "fcport" variable is never null here. I've updated the condition to test for the end of the list_for_each_entry() loop.

drivers/scsi/qla2xxx/qla_bsg.c +1 -1
index b905dfe..14ca275 100644
@@ -1050,7 +1050,7 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
 		break;
 	}
 
-	if (!fcport) {
+	if (&fcport->list = &vha->vp_fcports) {
 		DEBUG2(printk(KERN_ERR "%s(%ld): Failed to find port\n",
 			__func__, vha->host_no));
 		return -EINVAL;