aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_stats.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-10-20 18:17:43 -0400
committerDave Jones <davej@redhat.com>2005-10-20 18:17:43 -0400
commite98df50c5200ae3c748d69002a8827afc9d2eae2 (patch)
tree885c86b8b573d22176435b51f146bc6177acc13c /drivers/cpufreq/cpufreq_stats.c
parentbfdc708dc7d26fca66df0157b36356a2ba6166eb (diff)
[CPUFREQ] kzalloc conversions for cpufreq core.
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq_stats.c')
-rw-r--r--drivers/cpufreq/cpufreq_stats.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 741b6b191e6a..ff16a87125d9 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -192,9 +192,8 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
192 unsigned int cpu = policy->cpu; 192 unsigned int cpu = policy->cpu;
193 if (cpufreq_stats_table[cpu]) 193 if (cpufreq_stats_table[cpu])
194 return -EBUSY; 194 return -EBUSY;
195 if ((stat = kmalloc(sizeof(struct cpufreq_stats), GFP_KERNEL)) == NULL) 195 if ((stat = kzalloc(sizeof(struct cpufreq_stats), GFP_KERNEL)) == NULL)
196 return -ENOMEM; 196 return -ENOMEM;
197 memset(stat, 0, sizeof (struct cpufreq_stats));
198 197
199 data = cpufreq_cpu_get(cpu); 198 data = cpufreq_cpu_get(cpu);
200 if ((ret = sysfs_create_group(&data->kobj, &stats_attr_group))) 199 if ((ret = sysfs_create_group(&data->kobj, &stats_attr_group)))
@@ -216,12 +215,11 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
216 alloc_size += count * count * sizeof(int); 215 alloc_size += count * count * sizeof(int);
217#endif 216#endif
218 stat->max_state = count; 217 stat->max_state = count;
219 stat->time_in_state = kmalloc(alloc_size, GFP_KERNEL); 218 stat->time_in_state = kzalloc(alloc_size, GFP_KERNEL);
220 if (!stat->time_in_state) { 219 if (!stat->time_in_state) {
221 ret = -ENOMEM; 220 ret = -ENOMEM;
222 goto error_out; 221 goto error_out;
223 } 222 }
224 memset(stat->time_in_state, 0, alloc_size);
225 stat->freq_table = (unsigned int *)(stat->time_in_state + count); 223 stat->freq_table = (unsigned int *)(stat->time_in_state + count);
226 224
227#ifdef CONFIG_CPU_FREQ_STAT_DETAILS 225#ifdef CONFIG_CPU_FREQ_STAT_DETAILS