From b5e9e3fca6f9a945bc3a10c367f3ee4f71f7a59f Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Fri, 21 Feb 2014 17:42:57 +0100 Subject: [PATCH] cpufreq: conservative: Provide correct pointer for conservative governor This patch restores correct value of cs_dbs_info pointer for conservative governor at CPUFREQ_GOV_STOP event. Without this patch the NULL pointer dereference error shows up and cpufreq subsystem hangs. To trigger the behavior one needs to compile ondemand as default one. Then enable conservative governor and afterwards enable ondemand again. Change-Id: Iefd933f5984abb1a46d15357b9ea5f8492deeb08 Signed-off-by: Lukasz Majewski --- drivers/cpufreq/cpufreq_governor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 7eeb47f..5d7b8af 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -412,9 +412,10 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, break; case CPUFREQ_GOV_STOP: - if (governor == GOV_CONSERVATIVE) + if (governor == GOV_CONSERVATIVE) { + cs_dbs_info = dbs_data->cdata->get_cpu_dbs_info_s(cpu); cs_dbs_info->enable = 0; - + } gov_cancel_work(dbs_data, policy); mutex_lock(&dbs_data->mutex); -- 2.7.4