From: Viresh Kumar Date: Tue, 4 Mar 2014 03:44:00 +0000 (+0800) Subject: cpufreq: Initialize policy before making it available for others to use X-Git-Tag: v3.14-rc6~15^2^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a7e56a5d29071bcccd947dee6e3b9f8e4eb3309;p=pandora-kernel.git cpufreq: Initialize policy before making it available for others to use Policy must be fully initialized before it is being made available for use by others. Otherwise cpufreq_cpu_get() would be able to grab a half initialized policy structure that might not have affected_cpus (for example) populated. Then, anybody accessing those fields will get a wrong value and that will lead to unpredictable results. In order to fix this, do all the necessary initialization before we make the policy structure available via cpufreq_cpu_get(). That will guarantee that any code accessing fields of the policy will get correct data from them. Reported-by: Saravana Kannan Signed-off-by: Viresh Kumar [rjw: Changelog] Signed-off-by: Rafael J. Wysocki --- Reading git-diff-tree failed