From 577ec96e7d488a76765b18a767727391a0122af1 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Fri, 1 Nov 2013 13:27:32 +1300 Subject: [PATCH] libxc: check for xc_vcpu_setcontext failure in xc_domain_resume_any Coverity-ID: 1090352 Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper Acked-by: Ian Campbell --- tools/libxc/xc_resume.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c index 50724f22d7..18b4818426 100644 --- a/tools/libxc/xc_resume.c +++ b/tools/libxc/xc_resume.c @@ -211,15 +211,19 @@ static int xc_domain_resume_any(xc_interface *xch, uint32_t domid) /* Reset all secondary CPU states. */ for ( i = 1; i <= info.max_vcpu_id; i++ ) - xc_vcpu_setcontext(xch, domid, i, NULL); + if ( xc_vcpu_setcontext(xch, domid, i, NULL) != 0 ) + { + ERROR("Couldn't reset vcpu state"); + goto out; + } /* Ready to resume domain execution now. */ domctl.cmd = XEN_DOMCTL_resumedomain; domctl.domain = domid; rc = do_domctl(xch, &domctl); +out: #if defined(__i386__) || defined(__x86_64__) - out: if (p2m) munmap(p2m, P2M_FL_ENTRIES*PAGE_SIZE); if (p2m_frame_list) -- 2.30.2