]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: s390: Free the mmu cache when kvm_arch_vcpu_create() fails
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 12:40:37 +0000 (14:40 +0200)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Mon, 3 Aug 2026 14:51:34 +0000 (16:51 +0200)
commite4d678900a1ae66112812fe4d2aff16044ca37f2
treee571495f41fbd62823683bc0461312278b875b80
parentdab62d218754e00a22aff45d2b0116c5ee30cbd2
KVM: s390: Free the mmu cache when kvm_arch_vcpu_create() fails

The mmu cache is the first thing that is allocated in
kvm_arch_vcpu_create(), but in case of failure it was not freed.

Fix by freeing the mmu cache in case of failure.

Refactor kvm_arch_vcpu_create() to use scope-based cleanup instead of
gotos.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260803124040.126471-11-imbrenda@linux.ibm.com>
arch/s390/kvm/kvm-s390.c