summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorGuo Chao2012-06-15 05:31:56 +0200
committerMarcelo Tosatti2012-07-03 19:55:30 +0200
commit2106a548122ef0557dc51eae4f3f1a538cebfa79 (patch)
treeac750ce50686633dc7f28d4931216de78e85178e /arch/x86/kvm/vmx.c
parentapic: fix kvm build on UP without IOAPIC (diff)
downloadkernel-qcow2-linux-2106a548122ef0557dc51eae4f3f1a538cebfa79.tar.gz
kernel-qcow2-linux-2106a548122ef0557dc51eae4f3f1a538cebfa79.tar.xz
kernel-qcow2-linux-2106a548122ef0557dc51eae4f3f1a538cebfa79.zip
KVM: VMX: code clean for vmx_init()
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index eeeb4a25aed6..e10ec0e4d1c6 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -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