From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reshma Pattan Subject: [PATCH] lib/latencystats: free up the memzone Date: Thu, 26 Jul 2018 17:50:08 +0100 Message-ID: <1532623808-18558-1-git-send-email-reshma.pattan@intel.com> Cc: stable@dpdk.org, remy.horton@intel.com, Reshma Pattan To: dev@dpdk.org Return-path: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Free up the memzone allocated during the rte_latencystats_init(). Fixes: 5cd3cac9ed ("latency: added new library for latency stats") CC: stable@dpdk.org CC: remy.horton@intel.com Signed-off-by: Reshma Pattan --- lib/librte_latencystats/rte_latencystats.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c index 46c69bf05..1fdec68e3 100644 --- a/lib/librte_latencystats/rte_latencystats.c +++ b/lib/librte_latencystats/rte_latencystats.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2017 Intel Corporation + * Copyright(c) 2018 Intel Corporation */ #include @@ -265,6 +265,7 @@ rte_latencystats_uninit(void) uint16_t qid; int ret = 0; struct rxtx_cbs *cbs = NULL; + const struct rte_memzone *mz = NULL; /** De register Rx/Tx callbacks */ RTE_ETH_FOREACH_DEV(pid) { @@ -288,6 +289,11 @@ rte_latencystats_uninit(void) } } + /* free up the memzone */ + mz = rte_memzone_lookup(MZ_RTE_LATENCY_STATS); + if (mz) + rte_memzone_free(mz); + return 0; } -- 2.14.4