libxc: check for xc_vcpu_setcontext failure in xc_domain_resume_any
authorMatthew Daley <mattjd@gmail.com>
Fri, 1 Nov 2013 00:27:32 +0000 (13:27 +1300)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 1 Nov 2013 13:12:50 +0000 (13:12 +0000)
Coverity-ID: 1090352
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_resume.c

index 50724f22d71fffb6fd60c79c2e0551701f7a29bb..18b4818426a7310e507532b3f035c22050a2d1b8 100644 (file)
@@ -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)