aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2009-04-20 00:24:28 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-21 04:47:03 -0400
commit9a4f92a603cd72ee534cead20cbc627b34cfc884 (patch)
tree12acfcdca721ebbacf3b9f75cbb425f8fee7576e /drivers/net/mlx4
parent775d8d931581764a1ec982ebe5a927b12762fb6d (diff)
mlx4_en: Fix error handling while activating RX rings
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>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/en_rx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 7e40741fb7d8..8673008f72df 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -436,8 +436,9 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
436 /* Initialize page allocators */ 436 /* Initialize page allocators */
437 err = mlx4_en_init_allocator(priv, ring); 437 err = mlx4_en_init_allocator(priv, ring);
438 if (err) { 438 if (err) {
439 mlx4_err(mdev, "Failed initializing ring allocator\n"); 439 mlx4_err(mdev, "Failed initializing ring allocator\n");
440 goto err_allocator; 440 ring_ind--;
441 goto err_allocator;
441 } 442 }
442 443
443 /* Fill Rx buffers */ 444 /* Fill Rx buffers */
@@ -467,6 +468,7 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
467 ring->wqres.db.dma, &ring->srq); 468 ring->wqres.db.dma, &ring->srq);
468 if (err){ 469 if (err){
469 mlx4_err(mdev, "Failed to allocate srq\n"); 470 mlx4_err(mdev, "Failed to allocate srq\n");
471 ring_ind--;
470 goto err_srq; 472 goto err_srq;
471 } 473 }
472 ring->srq.event = mlx4_en_srq_event; 474 ring->srq.event = mlx4_en_srq_event;