[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v1] 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.

Signed-off-by: Chong Li <chong.li@xxxxxxxxx>

---
CC: <dario.faggioli@xxxxxxxxxx>
CC: <george.dunlap@xxxxxxxxxxxxx>
CC: <dgolomb@xxxxxxxxxxxxxx>
CC: <mengxu@xxxxxxxxxxxxx>
CC: <wei.liu2@xxxxxxxxxx>
CC: <ian.jackson@xxxxxxxxxxxxx>
CC: <lichong659@xxxxxxxxx>
---
 tools/libxc/xc_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index 221d17f..77aaa36 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,
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.