Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: be2iscsi: use rollback index when freeing MSI-X vectors
@ 2026-08-24  9:27 Runyu Xiao
  2026-08-24  9:40 ` sashiko-bot
  2026-08-24 11:32 ` [PATCH v2] " Runyu Xiao
  0 siblings, 2 replies; 4+ messages in thread
From: Runyu Xiao @ 2026-08-24  9:27 UTC (permalink / raw)
  To: Ketan Mukadam
  Cc: James E . J . Bottomley, Martin K . Petersen, Jitendra Bhivare,
	linux-scsi, linux-kernel, stable, Runyu Xiao, Jianhao Xu

beiscsi_init_irqs() unwinds previously registered MSI-X handlers with
free_irq(pci_irq_vector(pcidev, i), &phwi_context->be_eq[j]). The IRQ
number should match the rollback slot j, not the current loop index i.
Using i passes the wrong IRQ/dev_id pair and leaves earlier handlers
registered on failure.

Use j for pci_irq_vector() in the rollback loop.

Fixes: 831488669a33 ("scsi: be2iscsi: switch to pci_alloc_irq_vectors")
Cc: stable@vger.kernel.org

Assisted-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
---
 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 dc88bc46dcc0..3801da1c0229 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.34.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-24 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24  9:27 [PATCH] scsi: be2iscsi: use rollback index when freeing MSI-X vectors Runyu Xiao
2026-08-24  9:40 ` sashiko-bot
2026-08-24 11:32 ` [PATCH v2] " Runyu Xiao
2026-08-24 11:48   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox