提交 51a98e77 编写于 作者: C chenxiang 提交者: Xie XiuQi

scsi: hisi_sas: Put function hisi_sas_debugfs_exit() after free_irqs and...

scsi: hisi_sas: Put function hisi_sas_debugfs_exit() after free_irqs and destroy workqueue when removing hisi_sas driver

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Currently we call function hisi_sas_debugfs_exit() to remove debugfs_dir
before free irqs and destroy workqueue when removing hisi_sas driver.
If dump is triggered before function hisi_sas_debugfs_exit() but
debugfs_work may be called after it, so it may refer to already removed
debugfs_dir which will cause NULL pointer dereference.
To avoid it, put function hisi_sas_debugfs_exit() after free_irqs and
destroy workqueue when removing hisi_sas driver.
Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
Reviewed-by: NJohn Garry <john.garry@huawei.com>

Feature or Bugfix:Bugfix
Signed-off-by: Nchenxiang (M) <chenxiang66@hisilicon.com>
Reviewed-by: Nhuangdaode <huangdaode@hisilicon.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4a1aab5f
......@@ -3488,8 +3488,6 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev)
struct hisi_hba *hisi_hba = sha->lldd_ha;
struct Scsi_Host *shost = sha->core.shost;
hisi_sas_debugfs_exit(hisi_hba);
if (timer_pending(&hisi_hba->timer))
del_timer(&hisi_hba->timer);
......@@ -3501,6 +3499,7 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev)
pci_release_regions(pdev);
pci_disable_device(pdev);
hisi_sas_free(hisi_hba);
hisi_sas_debugfs_exit(hisi_hba);
scsi_host_put(shost);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册