Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
net/mlx5: fix leak on Tx queue creation failure
[ upstream commit b689b00 ]

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: f6d9ab4 ("net/mlx5: check Tx queue size overflow")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
  • Loading branch information
michaelbaum1 authored and bluca committed Feb 2, 2021
1 parent 5c53bc1 commit 0be706e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/mlx5/mlx5_txq.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0be706e

Please sign in to comment.