Re: [PATCH v2] cppc_cpufreq: Fix possible null pointer dereference

From: Viresh Kumar
Date: Fri Apr 19 2024 - 02:40:05 EST


On 08-04-24, 12:35, Aleksandr Mishin wrote:
> cppc_cpufreq_get_rate() and hisi_cppc_cpufreq_get_rate() can be called from
> different places with various parameters. So cpufreq_cpu_get() can return
> null as 'policy' in some circumstances.
> Fix this bug by adding null return check.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: a28b2bfc099c ("cppc_cpufreq: replace per-cpu data array with a list")
> Signed-off-by: Aleksandr Mishin <amishin@xxxxxxxxxx>
> ---
> v2: Fix mixed declarations
>
> drivers/cpufreq/cppc_cpufreq.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)

Applied. Thanks.

--
viresh