[PATCH V2] cpufreq: Always clear freq_table pointer
From: Viresh Kumar
Date: Fri Apr 12 2024 - 04:42:03 EST
The freq_table pointer must be cleared even if the exit() callback isn't
present.
Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
---
V2:
- Dropping the other change as it is covered by:
https://lore.kernel.org/all/20240411231818.2471-1-sensor1010@xxxxxxx/
drivers/cpufreq/cpufreq.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 66e10a19d76a..13980cb0527a 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1679,10 +1679,13 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy)
*/
if (cpufreq_driver->offline) {
cpufreq_driver->offline(policy);
- } else if (cpufreq_driver->exit) {
- cpufreq_driver->exit(policy);
- policy->freq_table = NULL;
+ return;
}
+
+ if (cpufreq_driver->exit)
+ cpufreq_driver->exit(policy);
+
+ policy->freq_table = NULL;
}
static int cpufreq_offline(unsigned int cpu)
--
2.31.1.272.g89b43f80a514