summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@Intel.com>2013-04-08 15:26:33 +0800
committerGleb Natapov <gleb@redhat.com>2013-04-08 10:56:08 +0300
commit458f212e36b291067b74c0cac2bdcf8278817ee7 (patch)
treedd3aca2ad7429b317d1bbb083d1fed68c5bc082e /arch
parent05e07f9bdb0ea3c1c52029e6c4db77c9f7c92a5c (diff)
KVM: x86: fix memory leak in vmx_init
Free vmx_msr_bitmap_longmode_x2apic and vmx_msr_bitmap_longmode if kvm_init() fails. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index b67f35475b09..1cf202cb47d5 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7741,7 +7741,7 @@ static int __init vmx_init(void)
r = kvm_init(&vmx_x86_ops, sizeof(struct vcpu_vmx),
__alignof__(struct vcpu_vmx), THIS_MODULE);
if (r)
- goto out3;
+ goto out5;
#ifdef CONFIG_KEXEC
rcu_assign_pointer(crash_vmclear_loaded_vmcss,
@@ -7789,6 +7789,8 @@ static int __init vmx_init(void)
return 0;
+out5:
+ free_page((unsigned long)vmx_msr_bitmap_longmode_x2apic);
out4:
free_page((unsigned long)vmx_msr_bitmap_longmode);
out3: