aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers/acpi
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-10-04 14:17:28 +0200
committerJan Beulich <jbeulich@suse.com>2011-10-04 14:17:28 +0200
commit91f47f155288b0116472a7ce64d8709f144a5357 (patch)
tree761fae4d9a2dbe8bd8de4b9dbace20fcc1d40b74 /xen/drivers/acpi
parentcef3d6c06771651b20504357379c3ad53d7673cd (diff)
downloadxen-91f47f155288b0116472a7ce64d8709f144a5357.tar.gz
xen-91f47f155288b0116472a7ce64d8709f144a5357.tar.bz2
xen-91f47f155288b0116472a7ce64d8709f144a5357.zip
use xzalloc in driver code
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/drivers/acpi')
-rw-r--r--xen/drivers/acpi/pmstat.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index ce8ed85dcf..7befee8bd2 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -221,9 +221,8 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
return -EAGAIN;
}
- if ( !(affected_cpus = xmalloc_array(uint32_t, op->u.get_para.cpu_num)) )
+ if ( !(affected_cpus = xzalloc_array(uint32_t, op->u.get_para.cpu_num)) )
return -ENOMEM;
- memset(affected_cpus, 0, op->u.get_para.cpu_num * sizeof(uint32_t));
for_each_cpu_mask(cpu, policy->cpus)
affected_cpus[j++] = cpu;
ret = copy_to_guest(op->u.get_para.affected_cpus,
@@ -233,10 +232,8 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
return ret;
if ( !(scaling_available_frequencies =
- xmalloc_array(uint32_t, op->u.get_para.freq_num)) )
+ xzalloc_array(uint32_t, op->u.get_para.freq_num)) )
return -ENOMEM;
- memset(scaling_available_frequencies, 0,
- op->u.get_para.freq_num * sizeof(uint32_t));
for ( i = 0; i < op->u.get_para.freq_num; i++ )
scaling_available_frequencies[i] =
pmpt->perf.states[i].core_frequency * 1000;
@@ -247,10 +244,8 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
return ret;
if ( !(scaling_available_governors =
- xmalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
+ xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) )
return -ENOMEM;
- memset(scaling_available_governors, 0,
- gov_num * CPUFREQ_NAME_LEN * sizeof(char));
if ( (ret = read_scaling_available_governors(scaling_available_governors,
gov_num * CPUFREQ_NAME_LEN * sizeof(char))) )
{