All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mlx5e: Correct order of closing qs on error
@ 2021-07-08 10:21 Kev Jackson
  0 siblings, 0 replies; only message in thread
From: Kev Jackson @ 2021-07-08 10:21 UTC (permalink / raw)
  To: Saeed Mahameed, Leon Romanovsky, David S. Miller, Jakub Kicinski
  Cc: linux-kernel, alasdair.mcwilliam, kevin.jackson

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@gmail.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-08 10:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-08 10:21 [PATCH] mlx5e: Correct order of closing qs on error Kev Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.