Skip to content

Commit 9aa0a48

Browse files
author
Roland Dreier
committed
IB/mthca: Don't double-free IRQs when falling back from MSI-X to INTx
When both MSI-X and legacy INTx fail to generate an interrupt, the driver frees the MSI-X interrupts twice. Fix this by clearing the have_irq flag for the MSI-X interrupts when they are freed the first time. Reported-by: Yinghai Lu <[email protected]> Tested-by: Yinghai Lu <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
1 parent c1f67a8 commit 9aa0a48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/infiniband/hw/mthca/mthca_eq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,11 @@ static void mthca_free_irqs(struct mthca_dev *dev)
641641
if (dev->eq_table.have_irq)
642642
free_irq(dev->pdev->irq, dev);
643643
for (i = 0; i < MTHCA_NUM_EQ; ++i)
644-
if (dev->eq_table.eq[i].have_irq)
644+
if (dev->eq_table.eq[i].have_irq) {
645645
free_irq(dev->eq_table.eq[i].msi_x_vector,
646646
dev->eq_table.eq + i);
647+
dev->eq_table.eq[i].have_irq = 0;
648+
}
647649
}
648650

649651
static int mthca_map_reg(struct mthca_dev *dev,

0 commit comments

Comments
 (0)