Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpufreq: cppc: Fix invalid return value in .get() callback

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@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>

authored by

Marc Zyngier and committed by
Viresh Kumar
2b8e6b58 73b24dc7

+1 -1
+1 -1
drivers/cpufreq/cppc_cpufreq.c
··· 747 747 int ret; 748 748 749 749 if (!policy) 750 - return -ENODEV; 750 + return 0; 751 751 752 752 cpu_data = policy->driver_data; 753 753