]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86, hvm: fix a domain_lock leak
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Jun 2009 13:35:45 +0000 (14:35 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 16 Jun 2009 13:35:45 +0000 (14:35 +0100)
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
xen-unstable changeset:   19764:775afcdc2759
xen-unstable date:        Tue Jun 16 13:33:12 2009 +0100

xen/arch/x86/hvm/hvm.c

index 0acd97dcba5087ce567442f8e6e0644398e879e1..599a30874b058edf22811d4584ba8181a51281b1 100644 (file)
@@ -504,11 +504,13 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     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;
@@ -2264,7 +2266,7 @@ static void hvm_s3_suspend(struct domain *d)
     vpic_reset(d);
     vioapic_reset(d);
     pit_reset(d);
-    rtc_reset(d);      
+    rtc_reset(d);
     pmtimer_reset(d);
     hpet_reset(d);