[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YObRs9tjVfGb9/Jn@linux-dev>
Date: Thu, 8 Jul 2021 11:21:39 +0100
From: Kev Jackson <foamdino@...il.com>
To: Saeed Mahameed <saeedm@...lanox.com>,
Leon Romanovsky <leon@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: linux-kernel@...r.kernel.org, alasdair.mcwilliam@...hutgroup.com,
kevin.jackson@...hutgroup.com
Subject: [PATCH] mlx5e: Correct order of closing qs on error
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@...il.com>
---
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
Powered by blists - more mailing lists