From: Michael Baum Date: Wed, 11 Nov 2020 07:36:45 +0000 (+0000) Subject: net/mlx5: fix leak on Rx queue creation failure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=41217cec2faa5ab5cf0a0a714135ed49b80911b5;p=dpdk.git net/mlx5: fix leak on Rx queue creation failure In Rx queue creation, there is a validation for the Rx configuration. When scatter offload validation for buffer split is failed, the Rx queue object memory was not freed what caused a memory leak. Free it. Fixes: a0a45e8af723 ("net/mlx5: configure Rx queue for buffer split") 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 4e6b8f456f..0693c924d0 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1506,7 +1506,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, dev->data->port_id, idx, mb_len, max_rx_pkt_len, RTE_PKTMBUF_HEADROOM); rte_errno = ENOSPC; - return NULL; + goto error; } tmpl->type = MLX5_RXQ_TYPE_STANDARD; if (mlx5_mr_btree_init(&tmpl->rxq.mr_ctrl.cache_bh,