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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0i=Ehi1icm4Tx6cXmdhjq-Qj8Vwv1SwzCyx5oBj-5y9hQ@mail.gmail.com>
Date: Wed, 19 Feb 2025 22:40:57 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Yu-Che Cheng <giver@...omium.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Daniel Lezcano <daniel.lezcano@...aro.org>, 
	Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>, 
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Chen-Yu Tsai <wenst@...omium.org>
Subject: Re: [PATCH] thermal: of: Fix logic in thermal_of_should_bind

On Wed, Feb 19, 2025 at 8:06 AM Yu-Che Cheng <giver@...omium.org> wrote:
>
> The current thermal_of_should_bind will stop iterating cooling-maps on
> the first matched trip point, leading to subsequent cooling devices
> binding to the same trip point failing to find the cooling spec.
>
> The iteration should continue enumerating subsequent cooling-maps if the
> target cooling device is not found.
>
> Fix the logic to break only when a matched cooling device is found.

OK, but ->

> Fixes: 94c6110b0b13 ("thermal/of: Use the .should_bind() thermal zone callback")
> Signed-off-by: Yu-Che Cheng <giver@...omium.org>
> ---
>  drivers/thermal/thermal_of.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 5ab4ce4daaeb..69c530e38574 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -312,7 +312,8 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
>                                 break;

-> I'd prefer to do a jump from here, that is

-                                 break;
+                                goto put_cm_np;
>                 }
>
> -               break;

and remove the break statement above altogether.

> +               if (result)
> +                       break;
>         }
>

And of course the label needs to be added too:

+put_cm_np:
>         of_node_put(cm_np);
>
> ---

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ