[2/2] net/mlx5: fix indexed pool incorrect trunks free
Checks
Commit Message
When the allocated trunks are used out, the pool trunk array will be
grown to a larger size to save more trunks.
Currently, when replace the pool trunk array to the new one. The code
wrongly frees the new trunk array.
Should free the old trunk array to fix the bug.
Fixes: 1702f7848f6a ("net/mlx5: add indexed memory pool")
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
---
drivers/net/mlx5/mlx5_utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -251,7 +251,7 @@ struct mlx5_indexed_pool *
trunk_tmp = pool->trunks;
pool->trunks = p;
if (trunk_tmp)
- pool->cfg.free(pool->trunks);
+ pool->cfg.free(trunk_tmp);
pool->n_trunk += n_grow;
}
if (!pool->cfg.release_mem_en) {