From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C6D030C15B; Thu, 28 May 2026 20:19:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999559; cv=none; b=qAWzTXbU+5uXZi5iicUSJ1bF+XGjOgASWxtASpuQIUD6RF1W0UT3wXT1nznG3sps8VyvqT5bfhbdiUAll/NEzPhDCMvtvvxNifOet6XyAGku6oLAXFEHiOKaDIkvlQYfXOxYK0hVkn7rfafQBi+TGNG3vMQ4hxTuZ3gGops4Xr4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779999559; c=relaxed/simple; bh=K4W1vfouaTtssfNOY81VAHjuDFyudFLAxJxOATm61YY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CN0gRR1OOa+bbhn/Bi1ecrHdmRbZu+Zdss7PxrGj5oRs67MWrjBXpwm8ZoEa9lH1Mjx48QaO9c/KZXctUFd292TTAg3KnXN3DG34N+IPCmmvJsAzjS/GEL+f2Qb5QNlO8tZaSYVTrQDpWYGNK6SDJEoAbCp0Y+xL4ehX7atNupk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C+6Zh7e9; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C+6Zh7e9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24C4C1F000E9; Thu, 28 May 2026 20:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779999557; bh=F6KzhLCIZo8fAvCa+rXE9djNh6xao4pP3NHGDqEvdxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=C+6Zh7e904qmGLVc0IcwpMxALOELMySNQjg1p1WOt+BIL744K8ZXAwhf2000oJi9w 42cHkeXktTjyEBY6XpnhQZYFGX3TDNyPSXoN1INCzfb5ATuoU/4CD2v03pdJUFJbFL 3dcFwD1t0AIXKtw5x/klc8rlzm2OsP2AVjm/cMAw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Will Deacon , Yuan Yao , Michael Bommarito , Marc Zyngier Subject: [PATCH 6.18 108/377] KVM: arm64: vgic: Free private_irqs when init fails after allocation Date: Thu, 28 May 2026 21:45:46 +0200 Message-ID: <20260528194641.468323340@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194638.371537336@linuxfoundation.org> References: <20260528194638.371537336@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Bommarito commit f19c354dbd457759dfcf1195ab4bdba2bb568323 upstream. 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 Reviewed-by: Yuan Yao Assisted-by: Claude:claude-opus-4-7 Signed-off-by: Michael Bommarito Link: https://lore.kernel.org/r/20260519135042.2219239-1-michael.bommarito@gmail.com Signed-off-by: Marc Zyngier Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kvm/arm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -490,8 +490,10 @@ int kvm_arch_vcpu_create(struct kvm_vcpu kvm_destroy_mpidr_data(vcpu->kvm); err = kvm_vgic_vcpu_init(vcpu); - if (err) + if (err) { + kvm_vgic_vcpu_destroy(vcpu); return err; + } err = kvm_share_hyp(vcpu, vcpu + 1); if (err)