提交 1b3ab5ad 编写于 作者: S Sean Christopherson 提交者: Paolo Bonzini

KVM: nVMX: Free the VMREAD/VMWRITE bitmaps if alloc_kvm_area() fails

Fixes: 34a1cd60 ("kvm: x86: vmx: move some vmx setting from vmx_init() to hardware_setup()")
Cc: stable@vger.kernel.org
Signed-off-by: NSean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 2a31b9db
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册