]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 10 Apr 2025 04:37:32 +0000 (10:07 +0530)
commit9992649f6786921873a9b89dafa5e04d8c5fef2b
tree8d683b66d91eb3abbc4e006dc28b8994fb19d8ae
parentd4f610a9bafdec8e3210789aa19335367da696ea
cpufreq: apple-soc: Fix null-ptr-deref in apple_soc_cpufreq_get_rate()

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>
drivers/cpufreq/apple-soc-cpufreq.c