clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe
[ Upstream commit9c59a01cab] pm_runtime_get_sync() will increment pm usage counter. Forgetting to putting operation will result in reference leak. Add missing pm_runtime_put_sync in some error paths. Fixes:9ac33b0ce8("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220602030838.52057-1-linmq006@gmail.com Reviewed-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9b65fd6513
commit
6d01017247
@@ -251,14 +251,16 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err("%s: failed to lookup atl clock %d\n", __func__,
|
pr_err("%s: failed to lookup atl clock %d\n", __func__,
|
||||||
i);
|
i);
|
||||||
return -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto pm_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
clk = of_clk_get_from_provider(&clkspec);
|
clk = of_clk_get_from_provider(&clkspec);
|
||||||
if (IS_ERR(clk)) {
|
if (IS_ERR(clk)) {
|
||||||
pr_err("%s: failed to get atl clock %d from provider\n",
|
pr_err("%s: failed to get atl clock %d from provider\n",
|
||||||
__func__, i);
|
__func__, i);
|
||||||
return PTR_ERR(clk);
|
ret = PTR_ERR(clk);
|
||||||
|
goto pm_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
cdesc = to_atl_desc(__clk_get_hw(clk));
|
cdesc = to_atl_desc(__clk_get_hw(clk));
|
||||||
@@ -291,8 +293,9 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev)
|
|||||||
if (cdesc->enabled)
|
if (cdesc->enabled)
|
||||||
atl_clk_enable(__clk_get_hw(clk));
|
atl_clk_enable(__clk_get_hw(clk));
|
||||||
}
|
}
|
||||||
pm_runtime_put_sync(cinfo->dev);
|
|
||||||
|
|
||||||
|
pm_put:
|
||||||
|
pm_runtime_put_sync(cinfo->dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user