diff options
author | Roland Dreier <rolandd@cisco.com> | 2009-06-14 16:30:45 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-06-14 16:30:45 -0400 |
commit | d1fdf24b4074a8d962f9a28519c99dcdd66bdee3 (patch) | |
tree | ad9a3b623b5f7a23811f68ae95e100119b037635 /drivers/net/mlx4/eq.c | |
parent | 9aa0a489d909af0cc36c41d3061ef956c7442ce2 (diff) |
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: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/eq.c')
-rw-r--r-- | drivers/net/mlx4/eq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c index 8830dcb92ec8..ce064e324200 100644 --- a/drivers/net/mlx4/eq.c +++ b/drivers/net/mlx4/eq.c | |||
@@ -497,8 +497,10 @@ static void mlx4_free_irqs(struct mlx4_dev *dev) | |||
497 | if (eq_table->have_irq) | 497 | if (eq_table->have_irq) |
498 | free_irq(dev->pdev->irq, dev); | 498 | free_irq(dev->pdev->irq, dev); |
499 | for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) | 499 | 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) { |
501 | free_irq(eq_table->eq[i].irq, eq_table->eq + i); | 501 | free_irq(eq_table->eq[i].irq, eq_table->eq + i); |
502 | eq_table->eq[i].have_irq = 0; | ||
503 | } | ||
502 | 504 | ||
503 | kfree(eq_table->irq_names); | 505 | kfree(eq_table->irq_names); |
504 | } | 506 | } |