summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorVenkat Gopalakrishnan <venkatg@codeaurora.org>2015-08-24 14:36:59 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:18 -0700
commitd397fec7fec5e6ead7dd3e54f48faca88aa71cf5 (patch)
tree25f3c7badbc9660e220c54ba46fb20b115eaceed /drivers/mmc
parent35cf59211f338f275a1a8ed7eb9c66771547241d (diff)
mmc: cmdq_hci: Fix pm ref count handling on error scenarios
Runtime pm get/put calls need to be called in pairs. Fix the unpaired call of runtime pm put after input validation. Change-Id: Ice2ba1e4d17ffde48b2f4d59801bb962f2e9aae7 Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/cmdq_hci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mmc/host/cmdq_hci.c b/drivers/mmc/host/cmdq_hci.c
index b2e23484bb5c..1cd274303d03 100644
--- a/drivers/mmc/host/cmdq_hci.c
+++ b/drivers/mmc/host/cmdq_hci.c
@@ -301,7 +301,7 @@ static int cmdq_enable(struct mmc_host *mmc)
pr_info("%s: %s: cq_host is already enabled\n",
mmc_hostname(mmc), __func__);
WARN_ON(1);
- goto out;
+ goto pm_ref_count;
}
if (cq_host->quirks & CMDQ_QUIRK_NO_DCMD)
@@ -321,7 +321,7 @@ static int cmdq_enable(struct mmc_host *mmc)
!cq_host->trans_desc_base) {
err = cmdq_host_alloc_tdl(cq_host);
if (err)
- goto out;
+ goto pm_ref_count;
}
cmdq_writel(cq_host, lower_32_bits(cq_host->desc_dma_base), CQTDLBA);
@@ -366,8 +366,10 @@ static int cmdq_enable(struct mmc_host *mmc)
if (cq_host->ops->enhanced_strobe_mask)
cq_host->ops->enhanced_strobe_mask(mmc, true);
-out:
+
+pm_ref_count:
cmdq_runtime_pm_put(cq_host);
+out:
return err;
}