From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5986E3239 for ; Mon, 13 Jul 2015 15:04:17 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 13 Jul 2015 06:04:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,462,1432623600"; d="scan'208";a="746124011" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 13 Jul 2015 06:04:15 -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 t6DD4Ers027859; Mon, 13 Jul 2015 14:04:14 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t6DD4EfB027056; Mon, 13 Jul 2015 14:04:14 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t6DD4ETD027052; Mon, 13 Jul 2015 14:04:14 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Mon, 13 Jul 2015 14:04:04 +0100 Message-Id: <1436792645-26831-2-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1436792645-26831-1-git-send-email-bernard.iremonger@intel.com> References: <1436792645-26831-1-git-send-email-bernard.iremonger@intel.com> Subject: [dpdk-dev] [PATCH v3 1/2] 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: Mon, 13 Jul 2015 13:04:19 -0000 Signed-off-by: Bernard Iremonger --- lib/librte_ether/rte_ethdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index b79e5f79..270697e 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -387,8 +387,12 @@ 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); + memset(eth_dev->data, 0, sizeof(struct rte_eth_dev_data)); + } eth_dev->pci_dev = NULL; eth_dev->driver = NULL; -- 1.9.1