Commit f4676665 authored by Xiang Chen's avatar Xiang Chen Committed by Martin K. Petersen

scsi: hisi_sas: Call sas_unregister_ha() to roll back if .hw_init() fails

Function sas_unregister_ha() needs to be called to roll back if
hisi_hba->hw->hw_init() fails in function hisi_sas_probe() or
hisi_sas_v3_probe(). Make that change.

Link: https://lore.kernel.org/r/1617709711-195853-4-git-send-email-john.garry@huawei.comSigned-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 4da0b7f6
...@@ -2689,12 +2689,14 @@ int hisi_sas_probe(struct platform_device *pdev, ...@@ -2689,12 +2689,14 @@ int hisi_sas_probe(struct platform_device *pdev,
rc = hisi_hba->hw->hw_init(hisi_hba); rc = hisi_hba->hw->hw_init(hisi_hba);
if (rc) if (rc)
goto err_out_register_ha; goto err_out_hw_init;
scsi_scan_host(shost); scsi_scan_host(shost);
return 0; return 0;
err_out_hw_init:
sas_unregister_ha(sha);
err_out_register_ha: err_out_register_ha:
scsi_remove_host(shost); scsi_remove_host(shost);
err_out_ha: err_out_ha:
......
...@@ -4761,7 +4761,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -4761,7 +4761,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
rc = hisi_sas_v3_init(hisi_hba); rc = hisi_sas_v3_init(hisi_hba);
if (rc) if (rc)
goto err_out_register_ha; goto err_out_hw_init;
scsi_scan_host(shost); scsi_scan_host(shost);
...@@ -4778,6 +4778,8 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -4778,6 +4778,8 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return 0; return 0;
err_out_hw_init:
sas_unregister_ha(sha);
err_out_register_ha: err_out_register_ha:
scsi_remove_host(shost); scsi_remove_host(shost);
err_out_free_irq_vectors: err_out_free_irq_vectors:
......
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