]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Don't free new memslot if allocation of said memslot fails
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 18 Feb 2020 21:07:17 +0000 (13:07 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:57:15 +0000 (17:57 +0100)
commitce6512811b1c9db844e949f09385650a79a3d374
treed5b361cb656b21d52054768f0c03981c3c419fe6
parent3ca767a87a2e737fda95e49a165ecfcda9609da2
KVM: Don't free new memslot if allocation of said memslot fails

The two implementations of kvm_arch_create_memslot() in x86 and PPC are
both good citizens and free up all local resources if creation fails.
Return immediately (via a superfluous goto) instead of calling
kvm_free_memslot().

Note, the call to kvm_free_memslot() is effectively an expensive nop in
this case as there are no resources to be freed.

No functional change intended.

Acked-by: Christoffer Dall <christoffer.dall@arm.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c