diff options
author | Yihang Li <liyihang9@huawei.com> | 2024-01-22 14:25:46 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2024-01-24 21:11:54 -0500 |
commit | 69097a631c034451a75ca7cb6025460ba3a08f80 (patch) | |
tree | daa22aa89be21d9c78e68201bd5b572918953572 /drivers/scsi/hisi_sas/hisi_sas_main.c | |
parent | 3f030550476566b12091687c70071d05ad433e0d (diff) |
scsi: hisi_sas: Check whether debugfs is enabled before removing or releasing it
hisi_sas debugfs remove should be executed only when debugfs is enabled.
Check whether debugfs is enabled and then remove it only if enabled.
Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1705904747-62186-4-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas/hisi_sas_main.c')
-rw-r--r-- | drivers/scsi/hisi_sas/hisi_sas_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 70c998d33ec9..0b66c733a40d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -2625,7 +2625,8 @@ static __exit void hisi_sas_exit(void) { sas_release_transport(hisi_sas_stt); - debugfs_remove(hisi_sas_debugfs_dir); + if (hisi_sas_debugfs_enable) + debugfs_remove(hisi_sas_debugfs_dir); } module_init(hisi_sas_init); |