Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aaeea921 authored by Venkat Gopalakrishnan's avatar Venkat Gopalakrishnan
Browse files

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: default avatarVenkat Gopalakrishnan <venkatg@codeaurora.org>
parent 7aa702be
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
}