]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: fix an error path that uses uninitialised rc in libxl_set_memory_target
authorWei Liu <wei.liu2@citrix.com>
Sun, 12 Jun 2016 14:09:50 +0000 (15:09 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 20 Jun 2016 13:47:02 +0000 (14:47 +0100)
ecdc6fd8 ("libxl: Fix libxl_set_memory_target return value") failed to
initialised rc in one failure path. Fix it in this patch.

Also fixed an indentation issue while I was there.

CID: 1362695

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c

index 5ec4c802496c1f88e14541e010d8e9198a4d92f6..1c81239303b9c3a61bd5a5ba88815fc6acfdcfeb 100644 (file)
@@ -4927,10 +4927,12 @@ retry_transaction:
 
     target = libxl__xs_read(gc, t, GCSPRINTF("%s/memory/target", dompath));
     if (!target && !domid) {
-        if (!xs_transaction_end(ctx->xsh, t, 1))
+        if (!xs_transaction_end(ctx->xsh, t, 1)) {
+            rc = ERROR_FAIL;
             goto out_no_transaction;
+        }
         lrc = libxl__fill_dom0_memory_info(gc, &current_target_memkb,
-                                          &current_max_memkb);
+                                           &current_max_memkb);
         if (lrc < 0) { rc = ERROR_FAIL; goto out_no_transaction; }
         goto retry_transaction;
     } else if (!target) {