]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: apple-soc: Fix null-ptr-deref in apple_soc_cpufreq_get_rate()
authorHenry Martin <bsdhenrymartin@gmail.com>
Wed, 9 Apr 2025 12:48:13 +0000 (20:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:50:42 +0000 (07:50 +0200)
commit1053dcf8a504d4933bb3f73df22bc363298d194b
tree0f98bd5248f699ef200768cfa93f2c946c8a613e
parent92d55d7051833116af0fc8664599f458e3dfa858
cpufreq: apple-soc: Fix null-ptr-deref in apple_soc_cpufreq_get_rate()

[ Upstream commit 9992649f6786921873a9b89dafa5e04d8c5fef2b ]

cpufreq_cpu_get_raw() can return NULL when the target CPU is not present
in the policy->cpus mask. apple_soc_cpufreq_get_rate() does not check
for this case, which results in a NULL pointer dereference.

Fixes: 6286bbb40576 ("cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/apple-soc-cpufreq.c