From: Michael Baum Date: Tue, 15 Dec 2020 08:48:31 +0000 (+0000) Subject: net/mlx5: fix leak on Rx queue creation failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e28e6c63a99d67929dedd9e4cdaeaa6d9a9a995d;p=dpdk.git net/mlx5: fix leak on Rx queue creation failure In Rx queue creation, there are some validations for the Rx configuration. When one of them fails, the MR btree memory was not freed what caused a memory leak. Free it. Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index df08f977bf..787b2b74dd 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1620,6 +1620,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, LIST_INSERT_HEAD(&priv->rxqsctrl, tmpl, next); return tmpl; error: + mlx5_mr_btree_free(&tmpl->rxq.mr_ctrl.cache_bh); mlx5_free(tmpl); return NULL; }