Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8b8b8ad authored by Joe Carnuccio's avatar Joe Carnuccio Committed by James Bottomley
Browse files

[SCSI] qla2xxx: Fix incorrect test after list_for_each_entry() exits.



list_for_each_entry() never leaves the iterator pointing to null.

Signed-off-by: default avatarJoe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 7ec0effd
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1266,6 +1266,7 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
	int rval = 0;
	int rval = 0;
	struct qla_port_param *port_param = NULL;
	struct qla_port_param *port_param = NULL;
	fc_port_t *fcport = NULL;
	fc_port_t *fcport = NULL;
	int found = 0;
	uint16_t mb[MAILBOX_REGISTER_COUNT];
	uint16_t mb[MAILBOX_REGISTER_COUNT];
	uint8_t *rsp_ptr = NULL;
	uint8_t *rsp_ptr = NULL;


@@ -1288,10 +1289,12 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
		if (memcmp(port_param->fc_scsi_addr.dest_addr.wwpn,
		if (memcmp(port_param->fc_scsi_addr.dest_addr.wwpn,
			fcport->port_name, sizeof(fcport->port_name)))
			fcport->port_name, sizeof(fcport->port_name)))
			continue;
			continue;

		found = 1;
		break;
		break;
	}
	}


	if (!fcport) {
	if (!found) {
		ql_log(ql_log_warn, vha, 0x7049,
		ql_log(ql_log_warn, vha, 0x7049,
		    "Failed to find port.\n");
		    "Failed to find port.\n");
		return -EINVAL;
		return -EINVAL;