From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 5CC63558E for ; Wed, 16 Mar 2016 14:14:29 +0100 (CET) Received: from [10.16.0.195] (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 5B39A25200; Wed, 16 Mar 2016 14:13:46 +0100 (CET) Message-ID: <56E95C29.1060600@6wind.com> Date: Wed, 16 Mar 2016 14:14:17 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Christian Ehrhardt , bruce.richardson@intel.com, dev@dpdk.org References: <1458131629-21925-1-git-send-email-christian.ehrhardt@canonical.com> <1458131629-21925-4-git-send-email-christian.ehrhardt@canonical.com> In-Reply-To: <1458131629-21925-4-git-send-email-christian.ehrhardt@canonical.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 3/3] lpm: fix missing free of lpm X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 13:14:29 -0000 Hi Christian, On 03/16/2016 01:33 PM, Christian Ehrhardt wrote: > Fixing lpm6 regarding a similar issue showed that that in rte_lpm_free lpm > might not be freed if it didn't find a te (early return) > > Acked-by: Bruce Richardson > Signed-off-by: Christian Ehrhardt > --- > lib/librte_lpm/rte_lpm.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c > index ccaaa2a..d5fa1f8 100644 > --- a/lib/librte_lpm/rte_lpm.c > +++ b/lib/librte_lpm/rte_lpm.c > @@ -360,12 +360,8 @@ rte_lpm_free_v20(struct rte_lpm_v20 *lpm) > if (te->data == (void *) lpm) > break; > } > - if (te == NULL) { > - rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); > - return; > - } > - > - TAILQ_REMOVE(lpm_list, te, next); > + if (te != NULL) > + TAILQ_REMOVE(lpm_list, te, next); > > rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK); > > I've just seen you had already posted a series on this topic. It looks that some free() are missing in lpm.c: Could you please check my version of the patch (which was not as complete as your series)? http://dpdk.org/dev/patchwork/patch/11526/ Regards, Olivier