net/mlx5: fix ipool memory leak
PATCH 1/1 net/mlx5: fix ipool memory leak
When ipool debug is enabled, there is internal memory to maintain the ipool cache allocation. Need to free it when destroying the ipool.
Fixes 3a2bda363 ("net/mlx5: add ipool debug checks")
Signed-off-by Rongwei Liu <[email protected]>
--- drivers/net/mlx5/mlx5_utils.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/mlx5/mlx5_utils.c +4 -0
@@ -871,6 +871,10 @@ mlx5_ipool_destroy(struct mlx5_indexed_pool *pool) pool->cfg.free (trunks);if (gc) pool->cfg.free (gc); +#ifdef POOL_DEBUG +if (pool->cache_validator.bmp_mem) + pool->cfg.free (pool->cache_validator.bmp_mem); +#endif mlx5_ipool_unlock (pool);mlx5_free (pool);return 0 ;
Signature · 1 line
2.27.0
Hi,
Quoted 8 lines · Rongwei Liu
When ipool debug is enabled, there is internal memory to maintain the ipool cache allocation. Need to free it when destroying the ipool.
Fixes 3a2bda363 ("net/mlx5: add ipool debug checks")Signed-off-by Rongwei Liu <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh