* [PATCH] clk: bcm: bcm53573: fix OF node leak in init
@ 2024-08-26 6:58 Krzysztof Kozlowski
2024-08-28 18:54 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-26 6:58 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, linux-clk, linux-kernel
Cc: Krzysztof Kozlowski
Driver code is leaking OF node reference from of_get_parent() in
bcm53573_ilp_init(). Usage of of_get_parent() is not needed in the
first place, because the parent node will not be freed while we are
processing given node (triggered by CLK_OF_DECLARE()). Thus fix the
leak by accessing parent directly, instead of of_get_parent().
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/clk/bcm/clk-bcm53573-ilp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/bcm/clk-bcm53573-ilp.c b/drivers/clk/bcm/clk-bcm53573-ilp.c
index 84f2af736ee8..83ef41d618be 100644
--- a/drivers/clk/bcm/clk-bcm53573-ilp.c
+++ b/drivers/clk/bcm/clk-bcm53573-ilp.c
@@ -112,7 +112,7 @@ static void bcm53573_ilp_init(struct device_node *np)
goto err_free_ilp;
}
- ilp->regmap = syscon_node_to_regmap(of_get_parent(np));
+ ilp->regmap = syscon_node_to_regmap(np->parent);
if (IS_ERR(ilp->regmap)) {
err = PTR_ERR(ilp->regmap);
goto err_free_ilp;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: bcm: bcm53573: fix OF node leak in init
2024-08-26 6:58 [PATCH] clk: bcm: bcm53573: fix OF node leak in init Krzysztof Kozlowski
@ 2024-08-28 18:54 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2024-08-28 18:54 UTC (permalink / raw)
To: Krzysztof Kozlowski, Michael Turquette, linux-clk, linux-kernel
Cc: Krzysztof Kozlowski
Quoting Krzysztof Kozlowski (2024-08-25 23:58:01)
> Driver code is leaking OF node reference from of_get_parent() in
> bcm53573_ilp_init(). Usage of of_get_parent() is not needed in the
> first place, because the parent node will not be freed while we are
> processing given node (triggered by CLK_OF_DECLARE()). Thus fix the
> leak by accessing parent directly, instead of of_get_parent().
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-28 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26 6:58 [PATCH] clk: bcm: bcm53573: fix OF node leak in init Krzysztof Kozlowski
2024-08-28 18:54 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox