diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2012-09-04 09:23:33 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 04:11:02 -0400 |
commit | ca579c9f136af4274ccfd1bcaee7f38a29a0e2e9 (patch) | |
tree | dffc2877f9ebe9adcb69bf4821d976357098b11c /drivers/s390/scsi | |
parent | cb45214960bc989af8b911ebd77da541c797717d (diff) |
[SCSI] zfcp: remove invalid reference to list iterator variable
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure. Thus this value should not be used after
the end of the iterator. Replace port->adapter->scsi_host by
adapter->scsi_host.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
Oversight in upsteam commit of v2.6.37
a1ca48319a9aa1c5b57ce142f538e76050bb8972
"[SCSI] zfcp: Move ACL/CFDC code to zfcp_cfdc.c"
which merged the content of zfcp_erp_port_access_changed().
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #2.6.37+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_cfdc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/scsi/zfcp_cfdc.c b/drivers/s390/scsi/zfcp_cfdc.c index fbd8b4db6025..49b82e46629e 100644 --- a/drivers/s390/scsi/zfcp_cfdc.c +++ b/drivers/s390/scsi/zfcp_cfdc.c | |||
@@ -293,7 +293,7 @@ void zfcp_cfdc_adapter_access_changed(struct zfcp_adapter *adapter) | |||
293 | } | 293 | } |
294 | read_unlock_irqrestore(&adapter->port_list_lock, flags); | 294 | read_unlock_irqrestore(&adapter->port_list_lock, flags); |
295 | 295 | ||
296 | shost_for_each_device(sdev, port->adapter->scsi_host) { | 296 | shost_for_each_device(sdev, adapter->scsi_host) { |
297 | zfcp_sdev = sdev_to_zfcp(sdev); | 297 | zfcp_sdev = sdev_to_zfcp(sdev); |
298 | status = atomic_read(&zfcp_sdev->status); | 298 | status = atomic_read(&zfcp_sdev->status); |
299 | if ((status & ZFCP_STATUS_COMMON_ACCESS_DENIED) || | 299 | if ((status & ZFCP_STATUS_COMMON_ACCESS_DENIED) || |