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

[Xen-devel] [PATCH] libxl: convert malloc() to libxl__zalloc(NULL, ...)



And ditch the error handling in libxl_get_cpu_topology()

Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3116,12 +3116,7 @@ libxl_cputopology *libxl_get_cpu_topolog
     if (tinfo.max_cpu_index < max_cpus - 1)
         max_cpus = tinfo.max_cpu_index + 1;
 
-    ret = malloc(sizeof(libxl_cputopology) * max_cpus);
-    if (ret == NULL) {
-        LIBXL__LOG_ERRNOVAL(ctx, XTL_ERROR, ENOMEM,
-                            "Unable to allocate return value");
-        goto fail;
-    }
+    ret = libxl__zalloc(NULL, sizeof(libxl_cputopology) * max_cpus);
 
     for (i = 0; i < max_cpus; i++) {
 #define V(map, i) (map[i] == INVALID_TOPOLOGY_ID) ? \

_______________________________________________
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®.