net/mlx5: fix Rx queue creation error flow
PATCH 1/2 net/mlx5: fix Rx queue creation error flow
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.
--- drivers/net/mlx5/mlx5_rxq.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/mlx5/mlx5_rxq.c +1 -0
@@ -1689,6 +1689,7 @@ struct mlx5_rxq_ctrl *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 ; }
Signature · 1 line
1.8.3.1
PATCH 2/2 net/mlx5: fix Tx queue creation error flow
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.
--- drivers/net/mlx5/mlx5_txq.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/mlx5/mlx5_txq.c +1 -0
@@ -1146,6 +1146,7 @@ struct mlx5_txq_ctrl *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 ; }
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [dpdk-stable] [PATCH 2/2] net/mlx5: fix Tx queue creation error flow
15/12/2020 09:48, Michael Baum:
Quoted 6 lines
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.
Quoted 7 lines
Free it.
Fixes f6d9ab4e769f ("net/mlx5: check Tx queue size overflow")Signed-off-by Michael Baum <[email protected]>Acked-by Matan Azrad <[email protected]>
It is not really fixing the queue creation but a leak. In such case, it is more explicit to say in title:
"fix leak on [...] failure"
Series applied in next-net-mlx with above wording, thanks.