diff options
author | Christoph Hellwig <hch@lst.de> | 2005-09-25 17:10:33 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-25 18:19:35 -0400 |
commit | fe8b2304e54552cea113318e2f66c45628130fdc (patch) | |
tree | d44cdc471ced18d6e41c8d25b857bb4381d6ec75 | |
parent | 44550322cb601ac3f882e7438bbeec971fa1b1a3 (diff) |
[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: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/scsi_transport_sas.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index ff724bbe6611..1d145d2f9a38 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c | |||
@@ -628,17 +628,16 @@ sas_rphy_delete(struct sas_rphy *rphy) | |||
628 | struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); | 628 | struct Scsi_Host *shost = dev_to_shost(parent->dev.parent); |
629 | struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); | 629 | struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); |
630 | 630 | ||
631 | transport_destroy_device(&rphy->dev); | 631 | scsi_remove_target(dev); |
632 | 632 | ||
633 | scsi_remove_target(&rphy->dev); | 633 | transport_remove_device(dev); |
634 | device_del(dev); | ||
635 | transport_destroy_device(dev); | ||
634 | 636 | ||
635 | spin_lock(&sas_host->lock); | 637 | spin_lock(&sas_host->lock); |
636 | list_del(&rphy->list); | 638 | list_del(&rphy->list); |
637 | spin_unlock(&sas_host->lock); | 639 | spin_unlock(&sas_host->lock); |
638 | 640 | ||
639 | transport_remove_device(dev); | ||
640 | device_del(dev); | ||
641 | transport_destroy_device(dev); | ||
642 | put_device(&parent->dev); | 641 | put_device(&parent->dev); |
643 | } | 642 | } |
644 | EXPORT_SYMBOL(sas_rphy_delete); | 643 | EXPORT_SYMBOL(sas_rphy_delete); |