Avoid panic in cpufreq_gov_stop.

Only execute the CPUFREQ_GOV_STOP logic if the governor has
actually been started.

Patch originated in OpenXT.

Signed-off-by: Christopher Clark <christopher.cla...@baesystems.com>
---
 xen/drivers/cpufreq/cpufreq_ondemand.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c
b/xen/drivers/cpufreq/cpufreq_ondemand.c
index 7fdba03..fe6c63d 100644
--- a/xen/drivers/cpufreq/cpufreq_ondemand.c
+++ b/xen/drivers/cpufreq/cpufreq_ondemand.c
@@ -273,6 +273,10 @@ int cpufreq_governor_dbs(struct cpufreq_policy
*policy, unsigned int event)
         break;

     case CPUFREQ_GOV_STOP:
+        if ( !this_dbs_info->enable )
+            /* Already not enabled */
+            break;
+
         dbs_timer_exit(this_dbs_info);
         dbs_enable--;

-- 
2.7.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to