linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] cpufreq: Always clear freq_table pointer
@ 2024-04-12  8:41 Viresh Kumar
  0 siblings, 0 replies; only message in thread
From: Viresh Kumar @ 2024-04-12  8:41 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar; +Cc: linux-pm, Vincent Guittot, linux-kernel

The freq_table pointer must be cleared even if the exit() callback isn't
present.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2:

- Dropping the other change as it is covered by:

  https://lore.kernel.org/all/20240411231818.2471-1-sensor1010@163.com/

 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-12  8:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12  8:41 [PATCH V2] cpufreq: Always clear freq_table pointer Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).