cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 28 Mar 2014 13:41:46 +0000 (19:11 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Apr 2014 12:43:49 +0000 (14:43 +0200)
commit71508a1f4f2286eea728a5994f1fb14b77340b47
tree7cac28dfabc7182c562f185919fe66c2e4f363ce
parentae87f10f35f75deb8f74dbd92d062200932c2f26
cpufreq: use kzalloc() to allocate memory for cpufreq_frequency_table

Few drivers are using kmalloc() to allocate memory for frequency
tables and since we will have an additional field '.flags' in
'struct cpufreq_frequency_table', these might become unstable.
Better get these fixed by replacing kmalloc() by kzalloc() instead.

Along with that we also remove use of .driver_data from SPEAr driver
as it doesn't use it at all. Also, writing zero to .driver_data is not
required for powernow-k8 as it is already zero.

Reported-and-reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/ia64-acpi-cpufreq.c
drivers/cpufreq/longhaul.c
drivers/cpufreq/powernow-k8.c
drivers/cpufreq/s3c24xx-cpufreq.c
drivers/cpufreq/spear-cpufreq.c