]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: scpi: Fix null-ptr-deref in scpi_cpufreq_get_rate()
authorHenry Martin <bsdhenrymartin@gmail.com>
Tue, 8 Apr 2025 15:03:54 +0000 (23:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 May 2025 05:39:25 +0000 (07:39 +0200)
commitad4796f2da495b2cbbd0fccccbcbf63f2aeee613
tree80241a6710598c33e0d3a306ab82867a242c5118
parent6b9f9b998b107c7539f148a013d789ddb860c3b9
cpufreq: scpi: Fix null-ptr-deref in scpi_cpufreq_get_rate()

[ Upstream commit 73b24dc731731edf762f9454552cb3a5b7224949 ]

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

Fixes: 343a8d17fa8d ("cpufreq: scpi: remove arm_big_little dependency")
Signed-off-by: Henry Martin <bsdhenrymartin@gmail.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/scpi-cpufreq.c