[PATCH v1] scsi: be2iscsi: Fix MSI-X IRQ unwind on request failure
From: Yuho Choi
Date: Fri Jul 03 2026 - 01:31:32 EST
beiscsi_init_irqs() unwinds previously requested MSI-X IRQs if a later
request_irq() call fails. The unwind loop walks index j, but passed the
failing index i to pci_irq_vector(), so free_irq() did not use the same
IRQ and dev_id pair that was registered.
Use j for both the IRQ vector and be_eq entry when freeing previously
registered MSI-X IRQs.
Fixes: 831488669a33 ("scsi: be2iscsi: switch to pci_alloc_irq_vectors")
Signed-off-by: Yuho Choi <dbgh9129@xxxxxxxxx>
---
drivers/scsi/be2iscsi/be_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index fd18d4d3d219..9833ab06b299 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -878,7 +878,7 @@ static int beiscsi_init_irqs(struct beiscsi_hba *phba)
return 0;
free_msix_irqs:
for (j = i - 1; j >= 0; j--) {
- free_irq(pci_irq_vector(pcidev, i), &phwi_context->be_eq[j]);
+ free_irq(pci_irq_vector(pcidev, j), &phwi_context->be_eq[j]);
kfree(phba->msi_name[j]);
}
return ret;
--
2.43.0