aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufshcd.c
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2016-10-27 17:25:58 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2016-11-08 17:30:00 -0500
commitafa3dfd42d205b106787476647735aa1de1a5d02 (patch)
tree684b4a10c87d673ff98368b05e1bdfcc4986f1ba /drivers/scsi/ufs/ufshcd.c
parentscsi: ufs: fix race between clock gating and devfreq scaling work (diff)
downloadlinux-dev-afa3dfd42d205b106787476647735aa1de1a5d02.tar.xz
linux-dev-afa3dfd42d205b106787476647735aa1de1a5d02.zip
scsi: ufshcd: release resources if probe fails
If ufshcd pltfrm/pci driver's probe fails for some reason then ensure that scsi host is released to avoid memory leak but managed memory allocations (via devm_* calls) need not to be freed explicitly on probe failure as memory allocated with these functions is automatically freed on driver detach. Reviewed-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.c')
-rw-r--r--drivers/scsi/ufs/ufshcd.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 5c931d1ba288..6c0082e2591e 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6253,8 +6253,6 @@ void ufshcd_remove(struct ufs_hba *hba)
ufshcd_disable_intr(hba, hba->intr_mask);
ufshcd_hba_stop(hba, true);
- scsi_host_put(hba->host);
-
ufshcd_exit_clk_gating(hba);
if (ufshcd_is_clkscaling_enabled(hba))
devfreq_remove_device(hba->devfreq);
@@ -6616,7 +6614,6 @@ exit_gating:
ufshcd_exit_clk_gating(hba);
out_disable:
hba->is_irq_enabled = false;
- scsi_host_put(host);
ufshcd_hba_exit(hba);
out_error:
return err;