From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH v2] libxc: check for xc_vcpu_setcontext failure in xc_domain_resume_any Date: Fri, 1 Nov 2013 13:27:32 +1300 Message-ID: <1383265652-10692-1-git-send-email-mattjd@gmail.com> References: <1383256617.5436.152.camel@dagon.hellion.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383256617.5436.152.camel@dagon.hellion.org.uk> 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 Coverity-ID: 1090352 Signed-off-by: Matthew Daley --- v2: Move 'out' label out of x86 #ifdef region 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 50724f2..18b4818 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) -- 1.7.10.4