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 927302952 for ; Wed, 2 Nov 2016 11:20:49 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP; 02 Nov 2016 03:20:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208";a="26465611" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 02 Nov 2016 03:20:47 -0700 From: Yuanhan Liu To: Reshma Pattan Date: Wed, 2 Nov 2016 18:20:59 +0800 Message-Id: <1478082097-16957-3-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: dpdk stable , Remy Horton Subject: [dpdk-stable] patch 'app/procinfo: free xstats memory upon failure' has been queued to stable release 16.07.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2016 10:20:50 -0000 Hi, FYI, your patch has been queued to stable release 16.07.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/06/16. So please shout if anyone has objections. Thanks. --yliu --- >>From fe0d47fe8dc4a0647e2450824a525f46c53ed959 Mon Sep 17 00:00:00 2001 From: Reshma Pattan Date: Tue, 4 Oct 2016 17:42:22 +0100 Subject: [PATCH] app/procinfo: free xstats memory upon failure [ upstream commit 4e1c139f79207ef1d67cf680970e801c902ae533 ] Some of the failures cases inside the nic_xstats_display() function doesn't free the allocated memory for the xstats and their names, memory is freed now. Fixes: e2aae1c1 ("ethdev: remove name from extended statistic fetch") Fixes: 22561383 ("app: replace dump_cfg by proc_info") Signed-off-by: Reshma Pattan Acked-by: Remy Horton --- app/proc_info/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/proc_info/main.c b/app/proc_info/main.c index 6dc0bbb..595f79f 100644 --- a/app/proc_info/main.c +++ b/app/proc_info/main.c @@ -268,7 +268,7 @@ nic_xstats_display(uint8_t port_id) if (len != rte_eth_xstats_get_names( port_id, xstats_names, len)) { printf("Cannot get xstat names\n"); - return; + goto err; } printf("###### NIC extended statistics for port %-2d #########\n", @@ -278,8 +278,7 @@ nic_xstats_display(uint8_t port_id) ret = rte_eth_xstats_get(port_id, xstats, len); if (ret < 0 || ret > len) { printf("Cannot get xstats\n"); - free(xstats); - return; + goto err; } for (i = 0; i < len; i++) @@ -289,6 +288,7 @@ nic_xstats_display(uint8_t port_id) printf("%s############################\n", nic_stats_border); +err: free(xstats); free(xstats_names); } -- 1.9.0