]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: endpoint: pci-epf-vntb: Fix MSI doorbell IRQ unwind
authorKoichiro Den <den@valinux.co.jp>
Tue, 17 Feb 2026 06:38:54 +0000 (15:38 +0900)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 24 Feb 2026 10:23:45 +0000 (15:53 +0530)
commitcc04f2bfb9dae60b6e34d6bff75c26d4ec3237ce
treea6b7e17fef7fadeaa18078ca414e58248b8d20f5
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
PCI: endpoint: pci-epf-vntb: Fix MSI doorbell IRQ unwind

epf_ntb_db_bar_init_msi_doorbell() requests ntb->db_count doorbell IRQs
and then performs additional MSI doorbell setup that may still fail.
The error path unwinds the requested IRQs, but it uses a loop variable
that is reused later in the function. When a later step fails, the
unwind can run with an unexpected index value and leave some IRQs
requested.

Track the number of successfully requested IRQs separately and use that
counter for the unwind so all previously requested IRQs are freed on
failure.

Fixes: dc693d606644 ("PCI: endpoint: pci-epf-vntb: Add MSI doorbell support")
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260217063856.3759713-2-den@valinux.co.jp
drivers/pci/endpoint/functions/pci-epf-vntb.c