cpufreq: Fix input handler crash
When input handler is running on a CPU not in ondemand
governor, skip making CPU frequency changes.
CRs-Fixed: 299451
Signed-off-by: David Ng <dave@codeaurora.org>
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index a175ae7..4079850 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -658,6 +658,11 @@
this_dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
policy = this_dbs_info->cur_policy;
+ if (!policy) {
+ /* CPU not using ondemand governor */
+ unlock_policy_rwsem_write(cpu);
+ return;
+ }
if (policy->cur < policy->max) {
policy->cur = policy->max;