scsi: ufshcd: Fix missing destroy_workqueue()

Add the missing destroy_workqueue() before return from ufshcd_init in the
error handling case as well as in ufshcd_remove.

Link: https://lore.kernel.org/r/20201110074223.41280-1-miaoqinglang@huawei.com
Fixes: 4db7a23605 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths")
Suggested-by: Avri Altman <Avri.Altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Qinglang Miao 2020-11-10 15:42:23 +08:00 committed by Martin K. Petersen
parent 0f52fcb99e
commit 2e6f11a797
1 changed files with 2 additions and 0 deletions

View File

@ -8928,6 +8928,7 @@ void ufshcd_remove(struct ufs_hba *hba)
blk_mq_free_tag_set(&hba->tmf_tag_set); blk_mq_free_tag_set(&hba->tmf_tag_set);
blk_cleanup_queue(hba->cmd_queue); blk_cleanup_queue(hba->cmd_queue);
scsi_remove_host(hba->host); scsi_remove_host(hba->host);
destroy_workqueue(hba->eh_wq);
/* disable interrupts */ /* disable interrupts */
ufshcd_disable_intr(hba, hba->intr_mask); ufshcd_disable_intr(hba, hba->intr_mask);
ufshcd_hba_stop(hba); ufshcd_hba_stop(hba);
@ -9228,6 +9229,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
exit_gating: exit_gating:
ufshcd_exit_clk_scaling(hba); ufshcd_exit_clk_scaling(hba);
ufshcd_exit_clk_gating(hba); ufshcd_exit_clk_gating(hba);
destroy_workqueue(hba->eh_wq);
out_disable: out_disable:
hba->is_irq_enabled = false; hba->is_irq_enabled = false;
ufshcd_hba_exit(hba); ufshcd_hba_exit(hba);