From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH 12/29] libxl: check for transaction abortion failure in libxl_set_memory_target Date: Wed, 30 Oct 2013 20:51:48 +1300 Message-ID: <1383119525-26033-13-git-send-email-mattjd@gmail.com> References: <1383119525-26033-1-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383119525-26033-1-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Matthew Daley , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- 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 29e66f2..0b29f32 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; } -- 1.7.10.4