Commit fe8b2304 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[SCSI] sas: fix remote phy removal

Brown paperbag bug:  sas_rphy_delete was ordered completely
wrong.  Fix it up to be the same order as sas_phy_delete or
fc_rport_terminate and fix rphy objects that leaked after module
removal.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 44550322
...@@ -628,17 +628,16 @@ sas_rphy_delete(struct sas_rphy *rphy) ...@@ -628,17 +628,16 @@ sas_rphy_delete(struct sas_rphy *rphy)
struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); struct Scsi_Host *shost = dev_to_shost(parent->dev.parent);
struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
transport_destroy_device(&rphy->dev); scsi_remove_target(dev);
scsi_remove_target(&rphy->dev); transport_remove_device(dev);
device_del(dev);
transport_destroy_device(dev);
spin_lock(&sas_host->lock); spin_lock(&sas_host->lock);
list_del(&rphy->list); list_del(&rphy->list);
spin_unlock(&sas_host->lock); spin_unlock(&sas_host->lock);
transport_remove_device(dev);
device_del(dev);
transport_destroy_device(dev);
put_device(&parent->dev); put_device(&parent->dev);
} }
EXPORT_SYMBOL(sas_rphy_delete); EXPORT_SYMBOL(sas_rphy_delete);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment