[PATCH] mlx5e: Correct order of closing qs on error

From: Kev Jackson
Date: Thu Jul 08 2021 - 06:21:45 EST


When attempting to open queues for a channel, on error the goto for
mlx5e_open_rq and mlx5e_open_xdpsq are inverted. This could lead to a q
not being correctly closed.

Signed-off-by: Kev Jackson <foamdino@xxxxxxxxx>
---
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index a836a02a2116..bf12a7790fac 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1858,21 +1858,21 @@ static int mlx5e_open_queues(struct mlx5e_channel *c,

err = mlx5e_open_rq(c, params, &cparam->rq, NULL, NULL, &c->rq);
if (err)
- goto err_close_xdp_sq;
+ goto err_close_rq;

err = mlx5e_open_xdpsq(c, params, &cparam->xdp_sq, NULL, &c->xdpsq, true);
if (err)
- goto err_close_rq;
+ goto err_close_xdp_sq;

return 0;

-err_close_rq:
- mlx5e_close_rq(&c->rq);
-
err_close_xdp_sq:
if (c->xdp)
mlx5e_close_xdpsq(&c->rq_xdpsq);

+err_close_rq:
+ mlx5e_close_rq(&c->rq);
+
err_close_sqs:
mlx5e_close_sqs(c);

--
2.30.2