aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_credit2.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-10-04 14:16:32 +0200
committerJan Beulich <jbeulich@suse.com>2011-10-04 14:16:32 +0200
commitcef3d6c06771651b20504357379c3ad53d7673cd (patch)
tree3b14f0c937b51fb8f38d78cfd4f27f63e9b92d1f /xen/common/sched_credit2.c
parentbeb8eac93c9a38c417db4ae77430af5568e54f1c (diff)
downloadxen-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/sched_credit2.c')
-rw-r--r--xen/common/sched_credit2.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 116cd77a14..089e493faf 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -732,10 +732,9 @@ csched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
struct csched_vcpu *svc;
/* Allocate per-VCPU info */
- svc = xmalloc(struct csched_vcpu);
+ svc = xzalloc(struct csched_vcpu);
if ( svc == NULL )
return NULL;
- memset(svc, 0, sizeof(*svc));
INIT_LIST_HEAD(&svc->rqd_elem);
INIT_LIST_HEAD(&svc->sdom_elem);
@@ -1437,10 +1436,9 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
struct csched_dom *sdom;
int flags;
- sdom = xmalloc(struct csched_dom);
+ sdom = xzalloc(struct csched_dom);
if ( sdom == NULL )
return NULL;
- memset(sdom, 0, sizeof(*sdom));
/* Initialize credit and weight */
INIT_LIST_HEAD(&sdom->vcpu);
@@ -2065,10 +2063,9 @@ csched_init(struct scheduler *ops)
* set up basic structures, and a callback when the CPU info is
* available. */
- prv = xmalloc(struct csched_private);
+ prv = xzalloc(struct csched_private);
if ( prv == NULL )
return -ENOMEM;
- memset(prv, 0, sizeof(*prv));
ops->sched_data = prv;
spin_lock_init(&prv->lock);
INIT_LIST_HEAD(&prv->sdom);