]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit()
authorLiao Chang <liaochang1@huawei.com>
Sat, 26 Aug 2023 09:51:13 +0000 (09:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:54 +0000 (10:46 +0200)
[ Upstream commit 03997da042dac73c69e60d91942c727c76828b65 ]

Since the 'cpus' field of policy structure will become empty in the
cpufreq core API, it is better to use 'related_cpus' in the exit()
callback of driver.

Fixes: c3274763bfc3 ("cpufreq: powernow-k8: Initialize per-cpu data-structures properly")
Signed-off-by: Liao Chang <liaochang1@huawei.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/powernow-k8.c

index 32bb00a6fe0990568714024b5706f33d0459498a..3b9aa473ae8ff3b293b3e1cfdc34330267eff679 100644 (file)
@@ -1120,7 +1120,8 @@ static int powernowk8_cpu_exit(struct cpufreq_policy *pol)
 
        kfree(data->powernow_table);
        kfree(data);
-       for_each_cpu(cpu, pol->cpus)
+       /* pol->cpus will be empty here, use related_cpus instead. */
+       for_each_cpu(cpu, pol->related_cpus)
                per_cpu(powernow_data, cpu) = NULL;
 
        return 0;