|
@@ -672,12 +672,15 @@ err_out:
|
|
|
*/
|
|
|
void zfcp_port_dequeue(struct zfcp_port *port)
|
|
|
{
|
|
|
- wait_event(port->remove_wq, atomic_read(&port->refcount) == 0);
|
|
|
write_lock_irq(&zfcp_data.config_lock);
|
|
|
list_del(&port->list);
|
|
|
write_unlock_irq(&zfcp_data.config_lock);
|
|
|
- if (port->rport)
|
|
|
+ if (port->rport) {
|
|
|
port->rport->dd_data = NULL;
|
|
|
+ port->rport = NULL;
|
|
|
+ }
|
|
|
+ wait_event(port->remove_wq, atomic_read(&port->refcount) == 0);
|
|
|
+ cancel_work_sync(&port->rport_work); /* usually not necessary */
|
|
|
zfcp_adapter_put(port->adapter);
|
|
|
sysfs_remove_group(&port->sysfs_device.kobj, &zfcp_sysfs_port_attrs);
|
|
|
device_unregister(&port->sysfs_device);
|