public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: Fixed kernel crash caused by cpufreq issues
@ 2024-04-11 23:18 Lizhe
  2024-04-12  6:33 ` Viresh Kumar
  2024-04-12 11:26 ` Rafael J. Wysocki
  0 siblings, 2 replies; 3+ messages in thread
From: Lizhe @ 2024-04-11 23:18 UTC (permalink / raw)
  To: rafael, viresh.kumar, linux-pm, linux-kernel; +Cc: Lizhe

When the cpufreq_driver does not provide an exit() function.
cpufreq offline operations can result in a kernel crash.

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/cpufreq/cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 04d349372de3..e8660bc7d232 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1739,7 +1739,7 @@ static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
 	}
 
 	/* We did light-weight exit earlier, do full tear down now */
-	if (cpufreq_driver->offline)
+	if (cpufreq_driver->offline && cpufreq_driver->exit)
 		cpufreq_driver->exit(policy);
 
 	up_write(&policy->rwsem);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-12 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11 23:18 [PATCH] cpufreq: Fixed kernel crash caused by cpufreq issues Lizhe
2024-04-12  6:33 ` Viresh Kumar
2024-04-12 11:26 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox