From: Matthew Daley Date: Wed, 30 Oct 2013 07:51:48 +0000 (+1300) Subject: libxl: check for transaction abortion failure in libxl_set_memory_target X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6102 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5bc3a84608de002853048ea1f36c73fbb1304154;p=xen.git libxl: check for transaction abortion failure in libxl_set_memory_target While at it, correct the error handling of libxl__fill_dom0_memory_info; at that point there is no transaction to end in any manner. Coverity-ID: 1055046 Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 06520101f2..bede011157 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3676,12 +3676,11 @@ retry_transaction: target = libxl__xs_read(gc, t, libxl__sprintf(gc, "%s/memory/target", dompath)); if (!target && !domid) { - xs_transaction_end(ctx->xsh, t, 1); + if (!xs_transaction_end(ctx->xsh, t, 1)) + goto out_no_transaction; rc = libxl__fill_dom0_memory_info(gc, ¤t_target_memkb); - if (rc < 0) { - abort_transaction = 1; - goto out; - } + if (rc < 0) + goto out_no_transaction; goto retry_transaction; } else if (!target) { LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, @@ -3786,6 +3785,7 @@ out: if (errno == EAGAIN) goto retry_transaction; +out_no_transaction: GC_FREE; return rc; }