scsi: hisi_sas: Delete PHY timers when rmmod or probe failed
authorXiang Chen <chenxiang66@hisilicon.com>
Wed, 29 May 2019 09:58:42 +0000 (17:58 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Jun 2019 23:46:24 +0000 (19:46 -0400)
When removing the driver or when probe fails, we need to delete the PHY
timers.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 8a7feb8..256f93e 100644 (file)
@@ -2480,6 +2480,14 @@ EXPORT_SYMBOL_GPL(hisi_sas_alloc);
 
 void hisi_sas_free(struct hisi_hba *hisi_hba)
 {
+       int i;
+
+       for (i = 0; i < hisi_hba->n_phy; i++) {
+               struct hisi_sas_phy *phy = &hisi_hba->phy[i];
+
+               del_timer_sync(&phy->timer);
+       }
+
        if (hisi_hba->wq)
                destroy_workqueue(hisi_hba->wq);
 }