diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-03-28 14:41:46 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-07 14:43:49 +0200 |
commit | 71508a1f4f2286eea728a5994f1fb14b77340b47 (patch) | |
tree | 7cac28dfabc7182c562f185919fe66c2e4f363ce /drivers/cpufreq/longhaul.c | |
parent | cpufreq: don't print value of .driver_data from core (diff) | |
download | linux-71508a1f4f2286eea728a5994f1fb14b77340b47.tar.xz linux-71508a1f4f2286eea728a5994f1fb14b77340b47.zip |
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>
Diffstat (limited to 'drivers/cpufreq/longhaul.c')
-rw-r--r-- | drivers/cpufreq/longhaul.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 5c440f87ba8a..d00e5d1abd25 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -475,7 +475,7 @@ static int longhaul_get_ranges(void) return -EINVAL; } - longhaul_table = kmalloc((numscales + 1) * sizeof(*longhaul_table), + longhaul_table = kzalloc((numscales + 1) * sizeof(*longhaul_table), GFP_KERNEL); if (!longhaul_table) return -ENOMEM; |