From: Michael Baum Date: Mon, 12 Jul 2021 07:06:43 +0000 (+0300) Subject: regex/mlx5: fix leak on device removal X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a1fcde8c8083233d0ef747ae9156c23e8c65ae73;p=dpdk.git regex/mlx5: fix leak on device removal In the removal function, PMD releases all driver resources allocated in the probe function. The MR btree memory is allocated in the probe function, but it is not freed in remove function what caused a memory leak. Release it. Fixes: cda883bbb655 ("regex/mlx5: add dynamic memory registration to datapath") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Ori Kam --- diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c index 84ba2e5224..279b89acc9 100644 --- a/drivers/regex/mlx5/mlx5_regex.c +++ b/drivers/regex/mlx5/mlx5_regex.c @@ -272,6 +272,8 @@ mlx5_regex_dev_remove(struct rte_device *rte_dev) if (TAILQ_EMPTY(&mlx5_mem_event_list)) rte_mem_event_callback_unregister("MLX5_MEM_EVENT_CB", NULL); + if (priv->mr_scache.cache.table) + mlx5_mr_release_cache(&priv->mr_scache); if (priv->pd) mlx5_glue->dealloc_pd(priv->pd); if (priv->uar)