Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1fdf24b authored by Roland Dreier's avatar Roland Dreier
Browse files

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 <yhlu.kernel@gmail.com>.

Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 9aa0a489
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -497,8 +497,10 @@ static void mlx4_free_irqs(struct mlx4_dev *dev)
	if (eq_table->have_irq)
	if (eq_table->have_irq)
		free_irq(dev->pdev->irq, dev);
		free_irq(dev->pdev->irq, dev);
	for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i)
	for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i)
		if (eq_table->eq[i].have_irq)
		if (eq_table->eq[i].have_irq) {
			free_irq(eq_table->eq[i].irq, eq_table->eq + i);
			free_irq(eq_table->eq[i].irq, eq_table->eq + i);
			eq_table->eq[i].have_irq = 0;
		}


	kfree(eq_table->irq_names);
	kfree(eq_table->irq_names);
}
}