From 5bc3a84608de002853048ea1f36c73fbb1304154 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Wed, 30 Oct 2013 20:51:48 +1300 Subject: [PATCH] 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 --- tools/libxl/libxl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.30.2