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>
Tue, 18 Nov 2014 02:47:02 +0000 (11:47 +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 7eeb47f..5d7b8af 100644 (file)
@@ -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);