[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23466140-5d0c-435f-8e73-d1c4826930ec@huawei.com>
Date: Mon, 14 Apr 2025 09:35:03 +0800
From: "zhenglifeng (A)" <zhenglifeng1@...wei.com>
To: Marc Zyngier <maz@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-pm@...r.kernel.org>
CC: <stable@...r.kernel.org>, "Rafael J. Wysocki" <rafael@...nel.org>, Viresh
Kumar <viresh.kumar@...aro.org>
Subject: Re: [PATCH] cpufreq: cppc: Fix invalid return value in .get()
callback
On 2025/4/13 18:11, Marc Zyngier wrote:
> Returning a negative error code in a function with an unsigned
> return type is a pretty bad idea. It is probably worse when the
> justification for the change is "our static analisys tool found it".
>
> Fixes: cf7de25878a1 ("cppc_cpufreq: Fix possible null pointer dereference")
> Signed-off-by: Marc Zyngier <maz@...nel.org>
> Cc: stable@...r.kernel.org
> Cc: "Rafael J. Wysocki" <rafael@...nel.org>
> Cc: Viresh Kumar <viresh.kumar@...aro.org>
> ---
> drivers/cpufreq/cppc_cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index b3d74f9adcf0b..cb93f00bafdba 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -747,7 +747,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu)
> int ret;
>
> if (!policy)
> - return -ENODEV;
> + return 0;
>
> cpu_data = policy->driver_data;
>
Reviewed-by: Lifeng Zheng <zhenglifeng1@...wei.com>
Powered by blists - more mailing lists