]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: vgic: Free private_irqs when init fails after allocation
authorMichael Bommarito <michael.bommarito@gmail.com>
Tue, 19 May 2026 13:50:42 +0000 (09:50 -0400)
committerMarc Zyngier <maz@kernel.org>
Wed, 20 May 2026 07:08:17 +0000 (08:08 +0100)
commitf19c354dbd457759dfcf1195ab4bdba2bb568323
tree13c5133108df4d0c4afdfc0ed61e42a8c9f03287
parent9ce754ed8e7ab4e3999767ce1505f85c449ccb07
KVM: arm64: vgic: Free private_irqs when init fails after allocation

Companion to commit 250f25367b58 ("KVM: arm64: Tear down vGIC on
failed vCPU creation"), which added the missing kvm_vgic_vcpu_destroy()
call to the kvm_share_hyp() failure path in kvm_arch_vcpu_create(). The
kvm_vgic_vcpu_init() failure path immediately above it has the same
shape and still needs the same cleanup.

Call kvm_vgic_vcpu_destroy() when kvm_vgic_vcpu_init() fails so private
IRQs allocated before a redistributor iodev registration failure are
released before the failed vCPU is freed.

Fixes: 03b3d00a70b5 ("KVM: arm64: vgic: Allocate private interrupts on demand")
Cc: stable@vger.kernel.org
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Yuan Yao <yaoyuan@linux.alibaba.com>
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Link: https://lore.kernel.org/r/20260519135042.2219239-1-michael.bommarito@gmail.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/arm.c