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>
This commit is contained in:
parent
775d8d9315
commit
9a4f92a603
|
@ -436,8 +436,9 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
|
||||||
/* Initialize page allocators */
|
/* Initialize page allocators */
|
||||||
err = mlx4_en_init_allocator(priv, ring);
|
err = mlx4_en_init_allocator(priv, ring);
|
||||||
if (err) {
|
if (err) {
|
||||||
mlx4_err(mdev, "Failed initializing ring allocator\n");
|
mlx4_err(mdev, "Failed initializing ring allocator\n");
|
||||||
goto err_allocator;
|
ring_ind--;
|
||||||
|
goto err_allocator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill Rx buffers */
|
/* Fill Rx buffers */
|
||||||
|
@ -467,6 +468,7 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
|
||||||
ring->wqres.db.dma, &ring->srq);
|
ring->wqres.db.dma, &ring->srq);
|
||||||
if (err){
|
if (err){
|
||||||
mlx4_err(mdev, "Failed to allocate srq\n");
|
mlx4_err(mdev, "Failed to allocate srq\n");
|
||||||
|
ring_ind--;
|
||||||
goto err_srq;
|
goto err_srq;
|
||||||
}
|
}
|
||||||
ring->srq.event = mlx4_en_srq_event;
|
ring->srq.event = mlx4_en_srq_event;
|
||||||
|
|
Loading…
Reference in New Issue