]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: cppc: Fix invalid return value in .get() callback
authorMarc Zyngier <maz@kernel.org>
Sun, 13 Apr 2025 10:11:42 +0000 (11:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:44:29 +0000 (07:44 +0200)
commit46a35fe74bae0f2e09c6156d5164910d31069f55
treed1f3e7bb92a891b29b53e779f5d78836c2e92c0d
parent8fbaa76690f67a7cbad315f89d607b46e3e06ede
cpufreq: cppc: Fix invalid return value in .get() callback

[ Upstream commit 2b8e6b58889c672e1ae3601d9b2b070be4dc2fbc ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/cppc_cpufreq.c