Skip to contentSkip to conversation

x86,hvm: fix a potential domain_lock leak

PATCH New Kouya Shimura 1 participant 1 message Jun 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86,hvm: fix a potential domain_lock leak

xen/arch/x86/hvm/hvm.c +4 -2
diff -r 4448fae52553 xen/arch/x86/hvm/hvm.c
@@ -512,11 +512,13 @@ static int hvm_load_cpu_ctxt(struct doma
     vc = &v->arch.guest_context;
 
     /* Need to init this vcpu before loading its contents */
+    rc = 0;
     domain_lock(d);
     if ( !v->is_initialised )
-        if ( (rc = boot_vcpu(d, vcpuid, vc)) != 0 )
-            return rc;
+        rc = boot_vcpu(d, vcpuid, vc);
     domain_unlock(d);
+    if ( rc != 0 )
+        return rc;
 
     if ( hvm_load_entry(CPU, h, &ctxt) != 0 ) 
         return -EINVAL;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel