From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 13F5BC604 for ; Thu, 25 Jun 2015 16:30:34 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 25 Jun 2015 07:30:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,677,1427785200"; d="scan'208";a="514134216" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jun 2015 07:30:34 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5PEUVFR021527; Thu, 25 Jun 2015 15:30:31 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t5PEUV8P008661; Thu, 25 Jun 2015 15:30:31 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t5PEUVLC008657; Thu, 25 Jun 2015 15:30:31 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Thu, 25 Jun 2015 15:30:28 +0100 Message-Id: <1435242628-8619-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: Subject: [dpdk-dev] [PATCH] librte_ether: release memory in uninit function. 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: Thu, 25 Jun 2015 14:30:35 -0000 Signed-off-by: Bernard Iremonger --- lib/librte_ether/rte_ethdev.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index e13fde5..2404556 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -369,8 +369,14 @@ rte_eth_dev_uninit(struct rte_pci_device *pci_dev) /* free ether device */ rte_eth_dev_release_port(eth_dev); - if (rte_eal_process_type() == RTE_PROC_PRIMARY) + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + 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->mac_addrs); + rte_free(eth_dev->data->hash_mac_addrs); + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); + } eth_dev->pci_dev = NULL; eth_dev->driver = NULL; -- 1.7.4.1