From: Murthy Bhat <murthy.b...@microsemi.com>

- use sas_phy_delete rather than sas_phy_free which
  according to comments, should not be called for PHYs that
  have been set up successfully.

Reviewed-by: Scott Benesh <scott.ben...@microsemi.com>
Reviewed-by: Scott Teel <scott.t...@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barn...@microsemi.com>
Signed-off-by: Murthy Bhat <murthy.b...@microsemi.com>
Signed-off-by: Don Brace <don.br...@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_sas_transport.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_sas_transport.c 
b/drivers/scsi/smartpqi/smartpqi_sas_transport.c
index 6776dfc1d317..b7e28b9f8589 100644
--- a/drivers/scsi/smartpqi/smartpqi_sas_transport.c
+++ b/drivers/scsi/smartpqi/smartpqi_sas_transport.c
@@ -45,9 +45,9 @@ static void pqi_free_sas_phy(struct pqi_sas_phy *pqi_sas_phy)
        struct sas_phy *phy = pqi_sas_phy->phy;
 
        sas_port_delete_phy(pqi_sas_phy->parent_port->port, phy);
-       sas_phy_free(phy);
        if (pqi_sas_phy->added_to_port)
                list_del(&pqi_sas_phy->phy_list_entry);
+       sas_phy_delete(phy);
        kfree(pqi_sas_phy);
 }
 

Reply via email to