]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
cpufreq: prevent lockup on reading scaling_available_frequencies
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Wed, 7 Oct 2015 20:50:44 +0000 (13:50 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Oct 2015 19:47:56 +0000 (21:47 +0200)
When scaling_available_frequencies is read on an offlined cpu, then
either lockup or junk values are displayed. This is caused by
freed freq_table, which policy is using.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c

index ef5ed9470de9a59d371e34e7db24a434d1f11a9f..25c4c15103a0cd8759e006eaa10d9f9edbfb5872 100644 (file)
@@ -1436,8 +1436,10 @@ static void cpufreq_offline_finish(unsigned int cpu)
         * since this is a core component, and is essential for the
         * subsequent light-weight ->init() to succeed.
         */
-       if (cpufreq_driver->exit)
+       if (cpufreq_driver->exit) {
                cpufreq_driver->exit(policy);
+               policy->freq_table = NULL;
+       }
 }
 
 /**