From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2880937AF for ; Fri, 20 Nov 2015 13:32:25 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 20 Nov 2015 04:32:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,322,1444719600"; d="scan'208";a="855577423" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga002.jf.intel.com with ESMTP; 20 Nov 2015 04:32:23 -0800 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.13]) by IRSMSX101.ger.corp.intel.com ([169.254.1.236]) with mapi id 14.03.0248.002; Fri, 20 Nov 2015 12:32:21 +0000 From: "Mcnamara, John" To: Mauricio Vasquez B , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ring: Fix memory leakage in rte_pmd_ring_devuninit() Thread-Index: AQHRIlCbudeFnnhIAkqQmBs2oRVaVp6k2Jyg Date: Fri, 20 Nov 2015 12:32:21 +0000 Message-ID: References: <1447885757-13038-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> In-Reply-To: <1447885757-13038-1-git-send-email-mauricio.vasquezbernal@studenti.polito.it> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ring: Fix memory leakage in rte_pmd_ring_devuninit() 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: Fri, 20 Nov 2015 12:32:25 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mauricio Vasquez B > Sent: Wednesday, November 18, 2015 10:29 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ring: Fix memory leakage in > rte_pmd_ring_devuninit() >=20 > When freeing the device, it is also necessary to free rx_queues and > tx_queues >=20 > Signed-off-by: Mauricio Vasquez B > > --- > drivers/net/ring/rte_eth_ring.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/ring/rte_eth_ring.c > b/drivers/net/ring/rte_eth_ring.c index 9a31bce..e091e4f 100644 > --- a/drivers/net/ring/rte_eth_ring.c > +++ b/drivers/net/ring/rte_eth_ring.c > @@ -582,6 +582,9 @@ rte_pmd_ring_devuninit(const char *name) > return -ENODEV; >=20 > eth_dev_stop(eth_dev); > + > + rte_free(eth_dev->data->rx_queues); > + rte_free(eth_dev->data->tx_queues); > rte_free(eth_dev->data->dev_private); > rte_free(eth_dev->data); Hi, This should test for eth_dev->data before freeing the members. Like: if (eth_dev->data) { rte_free(eth_dev->data->rx_queues); rte_free(eth_dev->data->tx_queues); rte_free(eth_dev->data->dev_private); } Thanks, John