lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iw7uXE_cfU5VXOjFDg9GM8Hu0+hKxqfzU3v0OM5KK9oQ@mail.gmail.com>
Date: Fri, 23 Aug 2024 15:27:52 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: rafael@...nel.org, daniel.lezcano@...aro.org, rui.zhang@...el.com, 
	lukasz.luba@....com, linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] thermal/of: Fix duplicate of_node_put()

On Fri, Aug 23, 2024 at 9:08 AM Jinjie Ruan <ruanjinjie@...wei.com> wrote:
>
> In for_each_child_of_node(), if continue, of_node_put(prev) will be
> called by __of_get_next_child(), so remove the duplicate
> of_node_put(child).
>
> Fixes: 0f0a1b4ba3e4 ("thermal/of: Use the .should_bind() thermal zone callback")
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
>  drivers/thermal/thermal_of.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index dc43f50db890..85e7e3c43c7e 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -319,10 +319,8 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
>                 int count, i;
>
>                 tr_np = of_parse_phandle(child, "trip", 0);
> -               if (tr_np != trip->priv) {
> -                       of_node_put(child);
> +               if (tr_np != trip->priv)
>                         continue;
> -               }
>
>                 /* The trip has been found, look up the cdev. */
>                 count = of_count_phandle_with_args(child, "cooling-device", "#cooling-cells");
> --

Good catch, thank you!

I'll fix the original patch and reapply it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ