kvm: x86: Do proper cleanup if kvm_x86_ops->vm_init() fails
authorJunaid Shahid <junaids@google.com>
Fri, 29 Jul 2022 22:43:29 +0000 (15:43 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 24 Aug 2022 20:41:59 +0000 (13:41 -0700)
commitb24ede22538b4d984cbe20532bbcb303692e7f52
tree22d8cfc0728b7a45fb37dfcefd43c8ea0b342ff1
parent372d07084593dc7a399bf9bee815711b1fb1bcf2
kvm: x86: Do proper cleanup if kvm_x86_ops->vm_init() fails

If vm_init() fails [which can happen, for instance, if a memory
allocation fails during avic_vm_init()], we need to cleanup some
state in order to avoid resource leaks.

Signed-off-by: Junaid Shahid <junaids@google.com>
Link: https://lore.kernel.org/r/20220729224329.323378-1-junaids@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c