From: Matthew Daley Date: Fri, 1 Nov 2013 00:27:32 +0000 (+1300) Subject: libxc: check for xc_vcpu_setcontext failure in xc_domain_resume_any X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6085 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=577ec96e7d488a76765b18a767727391a0122af1;p=xen.git 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 --- 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)