From: Chong Li Date: Wed, 6 Apr 2016 20:30:38 +0000 (-0500) Subject: libxc: fix uninitialized variable when changing rtds scheduling parameters X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1354 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b5836f71e186c891231def53b415b3f340306613;p=xen.git libxc: fix uninitialized variable when changing rtds scheduling parameters Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build failure: in some cases (e.g., num_vcpus <=0), xc_sched_rtds_vcpu_get/set returns an uninitialized variable. Fix it. Reported-by: Andrew Cooper Signed-off-by: Chong Li Reviewed-by: Andrew Cooper --- diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c index 221d17fa7c..77aaa36ae1 100644 --- a/tools/libxc/xc_rt.c +++ b/tools/libxc/xc_rt.c @@ -68,7 +68,7 @@ int xc_sched_rtds_vcpu_set(xc_interface *xch, struct xen_domctl_schedparam_vcpu *vcpus, uint32_t num_vcpus) { - int rc; + int rc = 0; unsigned processed = 0; DECLARE_DOMCTL; DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus, @@ -102,7 +102,7 @@ int xc_sched_rtds_vcpu_get(xc_interface *xch, struct xen_domctl_schedparam_vcpu *vcpus, uint32_t num_vcpus) { - int rc; + int rc = 0; unsigned processed = 0; DECLARE_DOMCTL; DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,