Re: [PATCH 02/11] net/dpaa2: fix rx error queue memory leak on port close

Hemant Agrawal
2026-02-19T10:57:10Z

On 18-02-2026 21:34, Maxime Leroy wrote:
> The rx_err_vq is allocated separately with rte_zmalloc() in
> dpaa2_alloc_rx_tx_queues(), but dpaa2_free_rx_tx_queues() only frees
> its q_storage contents via dpaa2_queue_storage_free() — the struct
> dpaa2_queue itself is never freed, leaking memory on every port close.
>
> Add the missing rte_free() and NULL assignment.
>
> Fixes: 46d02eeaaeb8 ("net/dpaa2: fix queue freeing")
> Signed-off-by: Maxime Leroy <maxime@leroys.fr>
> ---
> drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index cef819650b..b75b934b17 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -691,6 +691,8 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)
> if (priv->flags & DPAAX_RX_ERROR_QUEUE_FLAG) {
> dpaa2_q = priv->rx_err_vq;
> dpaa2_queue_storage_free(dpaa2_q, RTE_MAX_LCORE);
> + rte_free(priv->rx_err_vq);
> + priv->rx_err_vq = NULL;
> }
>
> /*free memory for all queues (RX+TX) */
Similar change is also required in error handling path of
dpaa2_alloc_rx_tx_queues