summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-01-12 10:45:01 +0000
committerStephen Boyd <sboyd@kernel.org>2022-03-11 19:22:18 -0800
commit6d6ef58c2470da85a99119f74d34216c8074b9f0 (patch)
tree48ad948262e2c933b9c83cdc57b770493e65fcf9 /drivers/clk
parent7c55e8efd290438e9bd95f6c3e14d3fa4f71b323 (diff)
downloadlinux-6d6ef58c2470da85a99119f74d34216c8074b9f0.tar.bz2
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: 2db04f16b589 ("clk: tegra: Add EMC clock driver") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20220112104501.30655-1-linmq006@gmail.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/tegra/clk-tegra124-emc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c
index 74c1d894cca8..219c80653dbd 100644
--- a/drivers/clk/tegra/clk-tegra124-emc.c
+++ b/drivers/clk/tegra/clk-tegra124-emc.c
@@ -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;
}