From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id BA2C05F14 for ; Mon, 30 Jul 2018 18:22:17 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkAsX-00009D-VA; Mon, 30 Jul 2018 16:18:38 +0000 From: Christian Ehrhardt To: Nithin Dabilpuram Cc: Jasvinder Singh , dpdk stable Date: Mon, 30 Jul 2018 18:13:28 +0200 Message-Id: <20180730161342.16566-163-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'app/testpmd: fix buffer leak in TM command' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:22:17 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From c48bd26a410043e700353b99f2e4e179fa65783a Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Thu, 5 Jul 2018 11:15:46 +0530 Subject: [PATCH] app/testpmd: fix buffer leak in TM command [ upstream commit b23ee8f2ac5de4a52573f844ba3c4f3261c3f7e7 ] Free the buffer allocated for shared_shaper_id array in case of configuration without shared shapers. Fixes: 996cb153af06 ("app/testpmd: add commands for TM nodes and hierarchy commit") Signed-off-by: Nithin Dabilpuram Acked-by: Jasvinder Singh --- app/test-pmd/cmdline_tm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/test-pmd/cmdline_tm.c b/app/test-pmd/cmdline_tm.c index c904e44f0..7c1601fa2 100644 --- a/app/test-pmd/cmdline_tm.c +++ b/app/test-pmd/cmdline_tm.c @@ -1599,10 +1599,12 @@ static void cmd_add_port_tm_nonleaf_node_parsed(void *parsed_result, np.shaper_profile_id = res->shaper_profile_id; np.n_shared_shapers = n_shared_shapers; - if (np.n_shared_shapers) + if (np.n_shared_shapers) { np.shared_shaper_id = &shared_shaper_id[0]; - else - np.shared_shaper_id = NULL; + } else { + free(shared_shaper_id); + shared_shaper_id = NULL; + } np.nonleaf.n_sp_priorities = res->n_sp_priorities; np.stats_mask = res->stats_mask; @@ -1758,10 +1760,12 @@ static void cmd_add_port_tm_leaf_node_parsed(void *parsed_result, np.n_shared_shapers = n_shared_shapers; - if (np.n_shared_shapers) + if (np.n_shared_shapers) { np.shared_shaper_id = &shared_shaper_id[0]; - else - np.shared_shaper_id = NULL; + } else { + free(shared_shaper_id); + shared_shaper_id = NULL; + } np.leaf.cman = res->cman_mode; np.leaf.wred.wred_profile_id = res->wred_profile_id; -- 2.17.1