]> xenbits.xensource.com Git - xen.git/commitdiff
VMX: fix failure path in construct_vmcs
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Wed, 18 Sep 2013 12:45:42 +0000 (14:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Sep 2013 12:45:42 +0000 (14:45 +0200)
If the allocation fails, make sure to call vmx_vmcs_exit().

This is a candidate for backport.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
xen/arch/x86/hvm/vmx/vmcs.c

index 58d38b14a32465830065532ec6253f34c83dc135..0be561689fc12a43af3f2860bb32981c734cb4d4 100644 (file)
@@ -894,7 +894,10 @@ static int construct_vmcs(struct vcpu *v)
         unsigned long *msr_bitmap = alloc_xenheap_page();
 
         if ( msr_bitmap == NULL )
+        {
+            vmx_vmcs_exit(v);
             return -ENOMEM;
+        }
 
         memset(msr_bitmap, ~0, PAGE_SIZE);
         v->arch.hvm_vmx.msr_bitmap = msr_bitmap;