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 50F4EA04DB for ; Tue, 29 Sep 2020 05:31:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 150521BC17; Tue, 29 Sep 2020 05:31:56 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id CD7AA1B65F; Tue, 29 Sep 2020 05:31:49 +0200 (CEST) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id CD2A5C5E2A2CFF5BB173; Tue, 29 Sep 2020 11:31:46 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 11:31:38 +0800 From: wangyunjian To: CC: , , , , Yunjian Wang , Date: Tue, 29 Sep 2020 11:31:35 +0800 Message-ID: <49d4bdc58b81564788cfd31f16ef2e66c1673f6d.1601347917.git.wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-stable] [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Yunjian Wang In rte_efd_create() allocated memory for tailq entry, we should free it when error happens, otherwise it will lead to memory leak. Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang --- lib/librte_efd/rte_efd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index 6a799556d..0aa120f48 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -707,6 +707,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, error_unlock_exit: rte_mcfg_tailq_write_unlock(); + rte_free(te); rte_efd_free(table); return NULL; -- 2.23.0