From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH] member: fix memory leak on error Date: Fri, 22 Dec 2017 09:20:44 +0000 Message-ID: <08f1736c-e3ce-1dfd-02a1-032f990472d1@intel.com> References: <5c0a540f8917604a86e18f8da77fa0c2013b7fde.1513865858.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "Gobriel, Sameh" To: "Wang, Yipeng1" , "dev@dpdk.org" Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id C7A271B365 for ; Fri, 22 Dec 2017 10:20:48 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 22-Dec-17 12:01 AM, Wang, Yipeng1 wrote: > Thank you Anatoly for finding this issue. In the code I tried to reuse the rte_member_free function to free memory but it may not be executed through. > > Because of this, I may not properly release setsum struct neither. I will post a fix for both soon. > > Thanks Yep, i can see that now. Didn't think to look inside rte_member_free() :/ However, you're creating a race condition there - you're unlocking a tailq, and then locking (and unlocking) it again inside rte_member_free() - it probably needs _thread_unsafe() functions that you can call from behind the lock. -- Thanks, Anatoly