diff options
author | Jan Beulich <jbeulich@suse.com> | 2011-10-04 14:16:32 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2011-10-04 14:16:32 +0200 |
commit | cef3d6c06771651b20504357379c3ad53d7673cd (patch) | |
tree | 3b14f0c937b51fb8f38d78cfd4f27f63e9b92d1f /xen/common/domctl.c | |
parent | beb8eac93c9a38c417db4ae77430af5568e54f1c (diff) | |
download | xen-cef3d6c06771651b20504357379c3ad53d7673cd.tar.gz xen-cef3d6c06771651b20504357379c3ad53d7673cd.tar.bz2 xen-cef3d6c06771651b20504357379c3ad53d7673cd.zip |
use xzalloc in common code
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/domctl.c')
-rw-r--r-- | xen/common/domctl.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 57c906cb75..d0f0f28dd4 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -155,11 +155,9 @@ static unsigned int default_vcpu0_location(cpumask_t *online) /* Do an initial CPU placement. Pick the least-populated CPU. */ nr_cpus = last_cpu(cpu_online_map) + 1; - cnt = xmalloc_array(unsigned int, nr_cpus); + cnt = xzalloc_array(unsigned int, nr_cpus); if ( cnt ) { - memset(cnt, 0, nr_cpus * sizeof(*cnt)); - rcu_read_lock(&domlist_read_lock); for_each_domain ( d ) for_each_vcpu ( d, v ) @@ -511,9 +509,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl) BUG_ON(d->vcpu != NULL); BUG_ON(d->max_vcpus != 0); - if ( (vcpus = xmalloc_array(struct vcpu *, max)) == NULL ) + if ( (vcpus = xzalloc_array(struct vcpu *, max)) == NULL ) goto maxvcpu_out; - memset(vcpus, 0, max * sizeof(*vcpus)); /* Install vcpu array /then/ update max_vcpus. */ d->vcpu = vcpus; |