Skip to content

Commit d1fdf24

Browse files
author
Roland Dreier
committed
mlx4_core: 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. This is the same bug that was reported in ib_mthca by Yinghai Lu <[email protected]>. Signed-off-by: Roland Dreier <[email protected]>
1 parent 9aa0a48 commit d1fdf24

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/mlx4

1 file changed

+3
-1
lines changed

drivers/net/mlx4/eq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,10 @@ static void mlx4_free_irqs(struct mlx4_dev *dev)
497497
if (eq_table->have_irq)
498498
free_irq(dev->pdev->irq, dev);
499499
for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i)
500-
if (eq_table->eq[i].have_irq)
500+
if (eq_table->eq[i].have_irq) {
501501
free_irq(eq_table->eq[i].irq, eq_table->eq + i);
502+
eq_table->eq[i].have_irq = 0;
503+
}
502504

503505
kfree(eq_table->irq_names);
504506
}

0 commit comments

Comments
 (0)