From: Yihang Li <liyihang9@xxxxxxxxxx> commit 3f030550476566b12091687c70071d05ad433e0d upstream. In commit 63f0733d07ce ("scsi: hisi_sas: Allocate DFX memory during dump trigger"), the memory allocation time of the DFX is changed from device initialization to dump occurs, so .debugfs_itct is not a valid address and do not need to check. The parameter hisi_sas_debugfs_enable is enough to check whether automatic debugfs dump is triggered, so remove redunant checks. Fixes: 63f0733d07ce ("scsi: hisi_sas: Allocate DFX memory during dump trigger") Signed-off-by: Yihang Li <liyihang9@xxxxxxxxxx> Signed-off-by: Xiang Chen <chenxiang66@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/1705904747-62186-3-git-send-email-chenxiang66@xxxxxxxxxxxxx Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1579,7 +1579,7 @@ static int hisi_sas_controller_prereset( return -EPERM; } - if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) + if (hisi_sas_debugfs_enable) hisi_hba->hw->debugfs_snapshot_regs(hisi_hba); return 0; @@ -1967,7 +1967,7 @@ static bool hisi_sas_internal_abort_time struct hisi_hba *hisi_hba = dev_to_hisi_hba(device); struct hisi_sas_internal_abort_data *timeout = data; - if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) { + if (hisi_sas_debugfs_enable) { /* * If timeout occurs in device gone scenario, to avoid * circular dependency like: Patches currently in stable-queue which might be from liyihang9@xxxxxxxxxx are queue-6.6/scsi-hisi_sas-create-all-dump-files-during-debugfs-i.patch queue-6.6/scsi-hisi_sas-allocate-dfx-memory-during-dump-trigge.patch queue-6.6/scsi-hisi_sas-fix-a-deadlock-issue-related-to-automa.patch queue-6.6/scsi-hisi_sas-remove-redundant-checks-for-automatic-debugfs-dump.patch queue-6.6/scsi-hisi_sas-directly-call-register-snapshot-instea.patch