From b689b00dd253356567c4d95f55921ce6c0e87d80 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Tue, 15 Dec 2020 08:48:32 +0000 Subject: [PATCH] net/mlx5: fix leak on Tx queue creation failure In Tx queue creation, there are two validations for the Tx configuration. When one of them fails, the MR btree memory was not freed what caused a memory leak. Free it. Fixes: f6d9ab4e769f ("net/mlx5: check Tx queue size overflow") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_txq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index d96abef883..b81bb4a12d 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -1146,6 +1146,7 @@ mlx5_txq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, LIST_INSERT_HEAD(&priv->txqsctrl, tmpl, next); return tmpl; error: + mlx5_mr_btree_free(&tmpl->txq.mr_ctrl.cache_bh); mlx5_free(tmpl); return NULL; } -- 2.39.5