Skip to content

Commit cd82e6b

Browse files
committed
cpufreq: cppc: Fix invalid return value in .get() callback
JIRA: https://issues.redhat.com/browse/RHEL-83800 commit 2b8e6b5 Author: Marc Zyngier <maz@kernel.org> Date: Wed, 16 Apr 2025 13:37:44 +0000 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: cf7de25 ("cppc_cpufreq: Fix possible null pointer dereference") Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 14355bb commit cd82e6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/cppc_cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ static unsigned int cppc_cpufreq_get_rate(unsigned int cpu)
747747
int ret;
748748

749749
if (!policy)
750-
return -ENODEV;
750+
return 0;
751751

752752
cpu_data = policy->driver_data;
753753

0 commit comments

Comments
 (0)