Skip to content

Commit

Permalink
mlx4: FIX error flow when initializing EQ table
Browse files Browse the repository at this point in the history
If mlx4_create_eq() would fail for one of EQ's assigned for
completion handling, the code would try to free the same EQ
we failed to create.
The crash was found by Christoph Lameter

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yevgeny Petrilin authored and David S. Miller committed Jun 8, 2009
1 parent 6f536f4 commit a5b19b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/mlx4/eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,10 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
err = mlx4_create_eq(dev, dev->caps.num_cqs + MLX4_NUM_SPARE_EQE,
(dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
&priv->eq_table.eq[i]);
if (err)
if (err) {
--i;
goto err_out_unmap;
}
}

err = mlx4_create_eq(dev, MLX4_NUM_ASYNC_EQE + MLX4_NUM_SPARE_EQE,
Expand Down

0 comments on commit a5b19b6

Please sign in to comment.