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

[Xen-devel] [PATCH] libxl: don't leave libxl_set_memory_target() return value uninitialized



Commit ecdc6fd878 ("libxl: Fix libxl_set_memory_target return value")
deliberately made rc an uninitialized variable, but left a code path in
place where the variable doesn't get initialized. Use ERROR_INVAL in
this case to match behavior prior to that patch; arguably ERROR_FAIL
might be more appropriate.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Did Coverity not spot this yet?

--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4927,8 +4927,10 @@ 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_INVAL;
             goto out_no_transaction;
+        }
         lrc = libxl__fill_dom0_memory_info(gc, &current_target_memkb,
                                           &current_max_memkb);
         if (lrc < 0) { rc = ERROR_FAIL; goto out_no_transaction; }



Attachment: libxl-set_memory_target-return.patch
Description: Text document

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