KVM: VMX: code clean for vmx_init()
authorGuo Chao <yan@linux.vnet.ibm.com>
Fri, 15 Jun 2012 03:31:56 +0000 (11:31 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 3 Jul 2012 17:55:30 +0000 (14:55 -0300)
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c

index eeeb4a25aed679605be83ec154f6abc9cb1c7b4d..e10ec0e4d1c69b7ba12b3ce8baa0c26d4605405d 100644 (file)
@@ -7290,23 +7290,21 @@ static int __init vmx_init(void)
        if (!vmx_io_bitmap_a)
                return -ENOMEM;
 
+       r = -ENOMEM;
+
        vmx_io_bitmap_b = (unsigned long *)__get_free_page(GFP_KERNEL);
-       if (!vmx_io_bitmap_b) {
-               r = -ENOMEM;
+       if (!vmx_io_bitmap_b)
                goto out;
-       }
 
        vmx_msr_bitmap_legacy = (unsigned long *)__get_free_page(GFP_KERNEL);
-       if (!vmx_msr_bitmap_legacy) {
-               r = -ENOMEM;
+       if (!vmx_msr_bitmap_legacy)
                goto out1;
-       }
+
 
        vmx_msr_bitmap_longmode = (unsigned long *)__get_free_page(GFP_KERNEL);
-       if (!vmx_msr_bitmap_longmode) {
-               r = -ENOMEM;
+       if (!vmx_msr_bitmap_longmode)
                goto out2;
-       }
+
 
        /*
         * Allow direct access to the PC debug port (it is often used for I/O