Skip to contentSkip to conversation

libxc: fix uninitialized variable when changing rtds scheduling parameters

PATCH In review Chong Li 4 participants 4 messages Apr 6, 2016 – Apr 7, 2016

lore
Share & tools
lore

Chong Li

author
#0 lore raw

PATCH 1/1 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.

---
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>

---
 tools/libxc/xc_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/libxc/xc_rt.c +2 -2
index 221d17f..77aaa36 100644
@@ -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,
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Chong Li

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.

Quoted 8 lines

---
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>

LGTM.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Reviewed-by
#2 lore raw
Quoted 18 lines · Andrew Cooper
Quoted 9 lines · Chong Li

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.

Quoted 8 lines

---
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>
CC: <[email protected]>

Quoted 4 lines

LGTM.

Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
In reply to Andrew Cooper

Andrew Cooper writes ("Re: [Xen-devel] [PATCH v1] libxc: fix uninitialized variable when changing rtds scheduling parameters"):

Quoted 8 lines · Chong Li
Quoted 3 lines

Commit 046c2b503a89d21b41e4d555a9f75d02af00dbc6 introduces a build
failure: in some cases (e.g., num_vcpus <=0), xc_sched_rtds_vcpu_get/set returns an uninitialized variable.

LGTM.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel