diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2018-12-03 13:52:51 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-12-14 12:34:20 +0100 |
commit | 1b3ab5ad1b8ad99bae76ec583809c5f5a31c707c (patch) | |
tree | 97cf43c4656d94a75a7407529d9251f5aa75455e | |
parent | 2a31b9db153530df4aa02dac8c32837bf5f47019 (diff) | |
download | linux-1b3ab5ad1b8ad99bae76ec583809c5f5a31c707c.tar.bz2 |
KVM: nVMX: Free the VMREAD/VMWRITE bitmaps if alloc_kvm_area() fails
Fixes: 34a1cd60d17f ("kvm: x86: vmx: move some vmx setting from vmx_init() to hardware_setup()")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/x86/kvm/vmx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c379d0bfdcba..3ec47b7a94d6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8037,13 +8037,16 @@ static __init int hardware_setup(void) kvm_mce_cap_supported |= MCG_LMCE_P; - return alloc_kvm_area(); + r = alloc_kvm_area(); + if (r) + goto out; + return 0; out: for (i = 0; i < VMX_BITMAP_NR; i++) free_page((unsigned long)vmx_bitmap[i]); - return r; + return r; } static __exit void hardware_unsetup(void) |