From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31ED8A0561; Mon, 20 Apr 2020 04:35:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A00CD1C2A4; Mon, 20 Apr 2020 04:34:47 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 902D31C208 for ; Mon, 20 Apr 2020 04:34:44 +0200 (CEST) From: Suanming Mou To: viacheslavo@mellanox.com, matan@mellanox.com Cc: rasland@mellanox.com, dev@dpdk.org Date: Mon, 20 Apr 2020 10:34:36 +0800 Message-Id: <1587350076-58468-3-git-send-email-suanmingm@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com> References: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com> Subject: [dpdk-dev] [PATCH 2/2] net/mlx5: fix indexed pool incorrect trunks free X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/mlx5/mlx5_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c index 07a6283..2146ffd 100644 --- a/drivers/net/mlx5/mlx5_utils.c +++ b/drivers/net/mlx5/mlx5_utils.c @@ -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) { -- 1.8.3.1