Commit 6d6ef58c authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Stephen Boyd

clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver

The reference taken by 'of_find_device_by_node()' must be released when
not needed anymore.
Add the corresponding 'put_device()' in the error handling path.

Fixes: 2db04f16 ("clk: tegra: Add EMC clock driver")
Signed-off-by: default avatarMiaoqian Lin <linmq006@gmail.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20220112104501.30655-1-linmq006@gmail.comSigned-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 7c55e8ef
......@@ -198,6 +198,7 @@ static struct tegra_emc *emc_ensure_emc_driver(struct tegra_clk_emc *tegra)
tegra->emc = platform_get_drvdata(pdev);
if (!tegra->emc) {
put_device(&pdev->dev);
pr_err("%s: cannot find EMC driver\n", __func__);
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment