summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_bsg.c
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2013-08-27 07:37:29 +0200
committerJames Bottomley <JBottomley@Parallels.com>2013-09-03 16:28:00 +0200
commite8b8b8ad6e5218e2073a9dddcd9f97d6b4fc514e (patch)
treee5aa44c78de56217dd5dfc2323aa8920a4537808 /drivers/scsi/qla2xxx/qla_bsg.c
parent[SCSI] qla2xxx: Add support for ISP8044. (diff)
downloadlinux-e8b8b8ad6e5218e2073a9dddcd9f97d6b4fc514e.tar.xz
linux-e8b8b8ad6e5218e2073a9dddcd9f97d6b4fc514e.zip
[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: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_bsg.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_bsg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index ffcad26af968..fb5bd6e17e8a 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -1266,6 +1266,7 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
int rval = 0;
struct qla_port_param *port_param = NULL;
fc_port_t *fcport = NULL;
+ int found = 0;
uint16_t mb[MAILBOX_REGISTER_COUNT];
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,
fcport->port_name, sizeof(fcport->port_name)))
continue;
+
+ found = 1;
break;
}
- if (!fcport) {
+ if (!found) {
ql_log(ql_log_warn, vha, 0x7049,
"Failed to find port.\n");
return -EINVAL;