Unverified Commit da61439c authored by Johan Hovold's avatar Johan Hovold Committed by Stephen Boyd
Browse files

clk: tegra: tegra124-emc: fix device leak on set_rate()



Make sure to drop the reference taken when looking up the EMC device and
its driver data on first set_rate().

Note that holding a reference to a device does not prevent its driver
data from going away so there is no point in keeping the reference.

Fixes: 2db04f16 ("clk: tegra: Add EMC clock driver")
Fixes: 6d6ef58c ("clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver")
Cc: stable@vger.kernel.org	# 4.2: 6d6ef58c
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent abe368db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -197,8 +197,8 @@ static struct tegra_emc *emc_ensure_emc_driver(struct tegra_clk_emc *tegra)
	tegra->emc_node = NULL;

	tegra->emc = platform_get_drvdata(pdev);
	if (!tegra->emc) {
	put_device(&pdev->dev);
	if (!tegra->emc) {
		pr_err("%s: cannot find EMC driver\n", __func__);
		return NULL;
	}