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

[Xen-changelog] [xen master] libxl: correctly handle libxl_get_cpu_topology failure in libxl_{cpu, node}map_to_{node, cpu}map



commit 1e143e2ae8be3ba86c2e931a1ee8d91efca08f89
Author:     Matthew Daley <mattjd@xxxxxxxxx>
AuthorDate: Sun Sep 29 18:47:37 2013 +1300
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Oct 3 14:45:54 2013 +0100

    libxl: correctly handle libxl_get_cpu_topology failure in libxl_{cpu, 
node}map_to_{node, cpu}map
    
    Initialize nr_cpus to 0 so that if it is unchanged by a failing
    libxl_get_cpu_topology, libxl_cputopology_list_free still works OK
    afterward.
    
    Coverity-ID: 1055294
    Coverity-ID: 1055295
    Signed-off-by: Matthew Daley <mattjd@xxxxxxxxx>
    Acked-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
---
 tools/libxl/libxl_utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 4309e5e..244725b 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -650,7 +650,7 @@ int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
                             libxl_bitmap *cpumap)
 {
     libxl_cputopology *tinfo = NULL;
-    int nr_cpus, i, rc = 0;
+    int nr_cpus = 0, i, rc = 0;
 
     tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
     if (tinfo == NULL) {
@@ -673,7 +673,7 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
                             libxl_bitmap *nodemap)
 {
     libxl_cputopology *tinfo = NULL;
-    int nr_cpus, i, rc = 0;
+    int nr_cpus = 0, i, rc = 0;
 
     tinfo = libxl_get_cpu_topology(ctx, &nr_cpus);
     if (tinfo == NULL) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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