scsi: hisi_sas: Delete the debugfs folder of hisi_sas when the probe fails
authorLuo Jiaxing <luojiaxing@huawei.com>
Thu, 24 Oct 2019 14:08:24 +0000 (22:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:16:49 +0000 (19:16 +0100)
commit266bde856cbd31429b77791f93948cd9899b9da1
tree2c3fd3c408ffb202554e39680ccb842fea42318c
parente9eb98caa072a8bdad33b9fc6799e386fe8ee33f
scsi: hisi_sas: Delete the debugfs folder of hisi_sas when the probe fails

[ Upstream commit cabe7c10c97a0857a9fb14b6c772ab784947995d ]

Although if the debugfs initialization fails, we will delete the debugfs
folder of hisi_sas, but we did not consider the scenario where debugfs was
successfully initialized, but the probe failed for other reasons. We found
out that hisi_sas folder is still remain after the probe failed.

When probe fail, we should delete debugfs folder to avoid the above issue.

Link: https://lore.kernel.org/r/1571926105-74636-18-git-send-email-john.garry@huawei.com
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c