mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
clk: imx: imx6q: Fix device node reference leak in pll6_bypassed()
[ Upstream commit4b84d496c8] The function pll6_bypassed() calls of_parse_phandle_with_args() but never calls of_node_put() to release the reference, causing a memory leak. Fix this by adding proper cleanup calls on all exit paths. Fixes:3cc48976e9("clk: imx6q: handle ENET PLL bypass") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Link: https://patch.msgid.link/20260203-clk-imx6q-v3-1-6cd2696bb371@gmail.com Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
235c36a86c
commit
0d2ba7e2e4
@@ -238,8 +238,11 @@ static bool pll6_bypassed(struct device_node *node)
|
||||
return false;
|
||||
|
||||
if (clkspec.np == node &&
|
||||
clkspec.args[0] == IMX6QDL_PLL6_BYPASS)
|
||||
clkspec.args[0] == IMX6QDL_PLL6_BYPASS) {
|
||||
of_node_put(clkspec.np);
|
||||
break;
|
||||
}
|
||||
of_node_put(clkspec.np);
|
||||
}
|
||||
|
||||
/* PLL6 bypass is not part of the assigned clock list */
|
||||
@@ -249,6 +252,9 @@ static bool pll6_bypassed(struct device_node *node)
|
||||
ret = of_parse_phandle_with_args(node, "assigned-clock-parents",
|
||||
"#clock-cells", index, &clkspec);
|
||||
|
||||
if (!ret)
|
||||
of_node_put(clkspec.np);
|
||||
|
||||
if (clkspec.args[0] != IMX6QDL_CLK_PLL6)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user