[PATCH v2] cpufreq: apple-soc: Fix null-ptr-deref in apple_soc_cpufreq_get_rate()
Viresh Kumar
viresh.kumar at linaro.org
Wed Apr 9 21:37:43 PDT 2025
On 09-04-25, 20:48, Henry Martin wrote:
> 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 at gmail.com>
> ---
> V1 -> V2: Use `if (unlikely(!policy))` instead of `if (!policy)`
>
> drivers/cpufreq/apple-soc-cpufreq.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
Applied. Thanks.
--
viresh
More information about the linux-arm-kernel
mailing list