cpufreq: conservative: Provide correct pointer for conservative governor
authorLukasz Majewski <l.majewski@samsung.com>
Fri, 21 Feb 2014 16:42:57 +0000 (17:42 +0100)
committerChanho Park <chanho61.park@samsung.com>
Thu, 20 Mar 2014 08:43:54 +0000 (17:43 +0900)
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 <l.majewski@samsung.com>
drivers/cpufreq/cpufreq_governor.c

index dabb888..a393e2a 100644 (file)
@@ -409,9 +409,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);