Skip to content

Commit 6d6ef58

Browse files
Yuuoniybebarino
authored andcommitted
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: 2db04f1 ("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>
1 parent 7c55e8e commit 6d6ef58

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/clk/tegra/clk-tegra124-emc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ static struct tegra_emc *emc_ensure_emc_driver(struct tegra_clk_emc *tegra)
198198

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

0 commit comments

Comments
 (0)