Skip to content

Commit

Permalink
mlx4_en: Fix error handling while activating RX rings
Browse files Browse the repository at this point in the history
In case of failure of either srq creation or page allocation,
the cleanup code handled the failed ring as well, and tried
to destroy resources that where not allocated.

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 Apr 21, 2009
1 parent 775d8d9 commit 9a4f92a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/mlx4/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
/* Initialize page allocators */
err = mlx4_en_init_allocator(priv, ring);
if (err) {
mlx4_err(mdev, "Failed initializing ring allocator\n");
goto err_allocator;
mlx4_err(mdev, "Failed initializing ring allocator\n");
ring_ind--;
goto err_allocator;
}

/* Fill Rx buffers */
Expand Down Expand Up @@ -467,6 +468,7 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
ring->wqres.db.dma, &ring->srq);
if (err){
mlx4_err(mdev, "Failed to allocate srq\n");
ring_ind--;
goto err_srq;
}
ring->srq.event = mlx4_en_srq_event;
Expand Down

0 comments on commit 9a4f92a

Please sign in to comment.