[PATCH 1/5] mlx4_en: Fix error handling while activating RX rings

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yevgeny Petrilin
Date: Monday, April 20, 2009 - 7:24 am

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>
---
 drivers/net/mlx4/en_rx.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 7e40741..8673008 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)
 		/* 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 */
@@ -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;
-- 
1.5.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/5] mlx4_en: Fix error handling while activating R ..., Yevgeny Petrilin, (Mon Apr 20, 7:24 am)
Re: [PATCH 2/5]mlx4_en: Fix a race at restart task, Yevgeny Petrilin, (Mon Apr 20, 7:26 am)
[PATCH 3/5] mlx4_en: Assign dummy event handler for TX queue, Yevgeny Petrilin, (Mon Apr 20, 7:30 am)
Re: [PATCH 2/5]mlx4_en: Fix a race at restart task, David Miller, (Tue Apr 21, 1:49 am)
[PATCH 1/2] mlx4_en: Fix cleanup flow on cq activation, Yevgeny Petrilin, (Sun Apr 26, 11:41 pm)
[PATCH 2/2] mlx4_en: Handle page allocation failure during ..., Yevgeny Petrilin, (Sun Apr 26, 11:42 pm)
[PATCH] mlx4_en: Fix not deleted napi structures, Yevgeny Petrilin, (Wed May 13, 4:47 am)
Re: [PATCH] mlx4_en: Fix not deleted napi structures, David Miller, (Sun May 17, 8:49 pm)
[PATCH 1/2] mlx4_en: Removed redundant stride variable, Yevgeny Petrilin, (Sun May 24, 6:16 am)
[PATCH 2/2] mlx4_en: Fix partial rings feature, Yevgeny Petrilin, (Sun May 24, 6:17 am)
Re: [PATCH 2/2] mlx4_en: Fix partial rings feature, David Miller, (Mon May 25, 12:36 am)
Re: [net-2.6 PATCH] mlx4_en: Fix a kernel panic when wakin ..., Yevgeny Petrilin, (Mon May 25, 11:49 pm)
[net-2.6 PATCH V2] mlx4_en: Fix a kernel panic when waking ..., Yevgeny Petrilin, (Mon May 25, 11:57 pm)
Re: [net-2.6 PATCH V2] mlx4_en: Fix a kernel panic when wa ..., Yevgeny Petrilin, (Tue May 26, 11:08 pm)
[PATCH 1/8] mlx4_en: Giving interface name in debug messages, Yevgeny Petrilin, (Mon Jun 1, 11:27 pm)
[PATCH 3/8] mlx4_en renamed en_params.c to en_ethtool.c, Yevgeny Petrilin, (Tue Jun 2, 2:21 am)
[PATCH 4/8] mlx4_en: Work with part of the ports., Yevgeny Petrilin, (Tue Jun 2, 2:22 am)
[PATCH 6/8] mlx4_en: multiqueue support, Yevgeny Petrilin, (Tue Jun 2, 2:24 am)
[PATCH 7/8] mlx4_en: Added vlan_features support, Yevgeny Petrilin, (Tue Jun 2, 2:28 am)
[PATCH 8/8] mlx4_en: Updated driver version, Yevgeny Petrilin, (Tue Jun 2, 2:29 am)
Re: [PATCH 8/8] mlx4_en: Updated driver version, David Miller, (Tue Jun 2, 2:36 am)