diff mbox series

[1/2] ARM: versatile: fix OF node leak in CPUs prepare

Message ID 20240826054934.10724-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State New
Headers show
Series [1/2] ARM: versatile: fix OF node leak in CPUs prepare | expand

Commit Message

Krzysztof Kozlowski Aug. 26, 2024, 5:49 a.m. UTC
Machine code is leaking OF node reference from of_find_matching_node()
in realview_smp_prepare_cpus().

Fixes: 5420b4b15617 ("ARM: realview: add an DT SMP boot method")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Not Cc-ing stable as this should have almost no impact, except code
correctness.
---
 arch/arm/mach-versatile/platsmp-realview.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Liviu Dudau Aug. 29, 2024, 12:33 p.m. UTC | #1
On Mon, Aug 26, 2024 at 07:49:33AM +0200, Krzysztof Kozlowski wrote:
> Machine code is leaking OF node reference from of_find_matching_node()
> in realview_smp_prepare_cpus().
> 
> Fixes: 5420b4b15617 ("ARM: realview: add an DT SMP boot method")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

I think Sudeep is going to take the series through his tree, but he might
be on holiday at this time.

Best regards,
Liviu

> 
> ---
> 
> Not Cc-ing stable as this should have almost no impact, except code
> correctness.
> ---
>  arch/arm/mach-versatile/platsmp-realview.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/mach-versatile/platsmp-realview.c b/arch/arm/mach-versatile/platsmp-realview.c
> index 6965a1de727b..d38b2e174257 100644
> --- a/arch/arm/mach-versatile/platsmp-realview.c
> +++ b/arch/arm/mach-versatile/platsmp-realview.c
> @@ -70,6 +70,7 @@ static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
>  		return;
>  	}
>  	map = syscon_node_to_regmap(np);
> +	of_node_put(np);
>  	if (IS_ERR(map)) {
>  		pr_err("PLATSMP: No syscon regmap\n");
>  		return;
> -- 
> 2.43.0
>
Sudeep Holla Aug. 29, 2024, 4:23 p.m. UTC | #2
On Thu, Aug 29, 2024 at 01:33:45PM +0100, Liviu Dudau wrote:
> On Mon, Aug 26, 2024 at 07:49:33AM +0200, Krzysztof Kozlowski wrote:
> > Machine code is leaking OF node reference from of_find_matching_node()
> > in realview_smp_prepare_cpus().
> > 
> > Fixes: 5420b4b15617 ("ARM: realview: add an DT SMP boot method")
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Acked-by: Liviu Dudau <liviu.dudau@arm.com>
> 
> I think Sudeep is going to take the series through his tree, but he might
> be on holiday at this time.
> 

I am not that lucky 
Linus Walleij Sept. 2, 2024, 8:19 a.m. UTC | #3
On Mon, Aug 26, 2024 at 7:49 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:

> Machine code is leaking OF node reference from of_find_matching_node()
> in realview_smp_prepare_cpus().
>
> Fixes: 5420b4b15617 ("ARM: realview: add an DT SMP boot method")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Collected these two on a branch, I'll try to get a pull request out
ASAP!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/arch/arm/mach-versatile/platsmp-realview.c b/arch/arm/mach-versatile/platsmp-realview.c
index 6965a1de727b..d38b2e174257 100644
--- a/arch/arm/mach-versatile/platsmp-realview.c
+++ b/arch/arm/mach-versatile/platsmp-realview.c
@@ -70,6 +70,7 @@  static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
 		return;
 	}
 	map = syscon_node_to_regmap(np);
+	of_node_put(np);
 	if (IS_ERR(map)) {
 		pr_err("PLATSMP: No syscon regmap\n");
 		return;