From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9659042BF0 for ; Wed, 31 May 2023 12:39:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 194164282D; Wed, 31 May 2023 12:39:37 +0200 (CEST) Received: from smtpbgbr2.qq.com (smtpbgbr2.qq.com [54.207.22.56]) by mails.dpdk.org (Postfix) with ESMTP id BBCA940ED7 for ; Wed, 31 May 2023 07:24:16 +0200 (CEST) X-QQ-mid: bizesmtp82t1685510629tdl7f998 Received: from steven.localdomain ( [183.81.182.182]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 31 May 2023 13:23:48 +0800 (CST) X-QQ-SSF: 01400000000000C0D000000A0000000 X-QQ-FEAT: xqT8U4SkSph7DAlu6elkfwnrcThyzLY66EHMxeCJRQCxQZaJVS149egM8HN0t M8qFVOmrmcO1evqZAO/NTMJhQ1VDU7EvtMqiezRNm8NDzMq0eLbfgn45J4htMl+bJ4gBDnX LWlPBjKo9aJwTiLT3ObumWiVoGIrO0n48nwTgbjeqB4oyrNWP4Zyoa95PbOymCpxJMqntA1 63y2lAwMvzBW5Cw7dtyLcpaHHnY8Sg2dfZN77lgeybDgL/gcBTO2MpelBKWpBLcLyT8xbwq Nh5EBxyJZzk/Yvk7pFSEllkBR3bFJuSucwzrmYUrxQeUMEbAR7U4bhX3S+2McCNemIpLWsS I/ObTJFjz1NmxTv8Ef4JEHpBVfhKmVTQjjSpL3Xerx6ld4QK4OdsNHNa3ussxn5kkkIbgY7 D6ua8Zk7sQA= X-QQ-GoodBg: 2 X-BIZMAIL-ID: 18117286418826802678 From: Wenbo Cao To: caowenbo@mucse.com Cc: Kamalakannan R , stable@dpdk.org, Cristian Dumitrescu Subject: [PATCH 2/3] pipeline: fix double free for table stats Date: Wed, 31 May 2023 05:23:32 +0000 Message-Id: <20230531052333.132446-2-caowenbo@mucse.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230531052333.132446-1-caowenbo@mucse.com> References: <20230531052333.132446-1-caowenbo@mucse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:mucse.com:qybglogicsvrgz:qybglogicsvrgz5a-3 X-Mailman-Approved-At: Wed, 31 May 2023 12:39:35 +0200 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 From: Kamalakannan R The pointer to the table statistics data structure needs to be set to NULL after free inside the table_build_free(), as this function is called from multiple places, leading to double memory free error. Similar fix for the learner_build_free() function. Fixes: 742b0a57f50e ("pipeline: add table statistics to SWX") Fixes: 4f59d3726147 ("pipeline: support learner tables") Cc: stable@dpdk.org Signed-off-by: Kamalakannan R Acked-by: Cristian Dumitrescu --- lib/pipeline/rte_swx_pipeline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c index dea1378095..da37eda231 100644 --- a/lib/pipeline/rte_swx_pipeline.c +++ b/lib/pipeline/rte_swx_pipeline.c @@ -8665,6 +8665,7 @@ table_build_free(struct rte_swx_pipeline *p) free(p->table_stats[i].n_pkts_action); free(p->table_stats); + p->table_stats = NULL; } } @@ -9579,6 +9580,7 @@ learner_build_free(struct rte_swx_pipeline *p) free(p->learner_stats[i].n_pkts_action); free(p->learner_stats); + p->learner_stats = NULL; } } -- 2.27.0