aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2009-08-18 09:43:06 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 09:49:04 -0400
commita67417ab7eeff45bba55666c0e1083260f3624ee (patch)
tree7f52c070bc9eeb7f5bdbb7f35e26e6ddb2624772 /drivers/s390/scsi/zfcp_scsi.c
parentcdf69bb91b0ef14f0e0a987a4430764e6c290644 (diff)
[SCSI] zfcp: invalid usage after free of port resources
In certain error scenarios ports, rports are getting attached, validated and removed from the systems environment. Depending on the layer this occurs asynchronously. This patch fixes the few races which existed and ensures all references and cross references are cleared at the time they're invalid. In addition fc transports actions are only scheduled when required. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 6925a178468..54a7a7474aa 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -582,8 +582,10 @@ void zfcp_scsi_schedule_rport_block(struct zfcp_port *port)
582 zfcp_port_get(port); 582 zfcp_port_get(port);
583 port->rport_task = RPORT_DEL; 583 port->rport_task = RPORT_DEL;
584 584
585 if (!queue_work(zfcp_data.work_queue, &port->rport_work)) 585 if (port->rport && queue_work(zfcp_data.work_queue, &port->rport_work))
586 zfcp_port_put(port); 586 return;
587
588 zfcp_port_put(port);
587} 589}
588 590
589void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) 591void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter)