From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 961651B64B; Sat, 23 Dec 2017 12:49:04 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Dec 2017 03:49:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,446,1508828400"; d="scan'208";a="14666788" Received: from mpaulett-mobl5.ger.corp.intel.com (HELO [10.252.20.236]) ([10.252.20.236]) by orsmga003.jf.intel.com with ESMTP; 23 Dec 2017 03:49:01 -0800 To: Olivier MATZ Cc: dev@dpdk.org, stable@dpdk.org References: <9d5a3bc7a779b2dddab4256aa3e0631737861f98.1513867589.git.anatoly.burakov@intel.com> <5dee0afeaa0d007dfc9d949b1975c97537585ca4.1513867589.git.anatoly.burakov@intel.com> <20171222162642.brpmnqhtovmlwxe2@platinum> From: "Burakov, Anatoly" Message-ID: Date: Sat, 23 Dec 2017 11:49:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171222162642.brpmnqhtovmlwxe2@platinum> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 3/6] test: fix memory leak in ring autotest 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: , X-List-Received-Date: Sat, 23 Dec 2017 11:49:05 -0000 On 22-Dec-17 4:26 PM, Olivier MATZ wrote: > Hi, > > On Fri, Dec 22, 2017 at 10:12:07AM +0000, Anatoly Burakov wrote: >> Fixes: af75078fece3 ("first public release") > > Not sure about this commit id: freeing rings is only possible > since commit 4e32101f9b01 ("ring: support freeing"). You're correct, i'll fix it in v2. > > [...] > >> @@ -894,6 +895,8 @@ test_ring(void) >> /* dump the ring status */ >> rte_ring_list_dump(stdout); >> >> + rte_ring_free(r); >> + >> return 0; > > I think this is incorrect: r is a static variable, and if it is > not set to NULL, it will be reused at next call. The point of these changes is not to leave any memory allocated after the test is done, regardless of whether it will be reused again. > > Ideally, removing the static variable would be better than just > resetting the value to NULL, but it will require more modifications: > add a ring argument to test function, and change return -1 -> goto fail. > ...or rewrite it with the testsuite and do proper setup and teardown :) Anyway, i'll implement the suggestion in v2. -- Thanks, Anatoly