From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD3F7A0C4C for ; Mon, 12 Jul 2021 15:06:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEF1540685; Mon, 12 Jul 2021 15:06:43 +0200 (CEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id ADAFF40685 for ; Mon, 12 Jul 2021 15:06:42 +0200 (CEST) Received: by mail-wr1-f44.google.com with SMTP id k4so19214849wrc.8 for ; Mon, 12 Jul 2021 06:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZqyQ7XMjYE5Lem5Esap5xk1ZCwQYIm+rQsYtC13GPlo=; b=hYH8wUIGbLomRq+QRdJpHkaWqFtEXlam/lbgd/UArwfeBFFNzvhoxjbGA0GL5Dm4Jw q9AkgYCkOOcr3dlLPssiSNwi+die6Jc4dxHzVam0ZLiZF5T4dr9TUQ0C5XqDVuCprtSr eOsHFdNwpNClLGQgLrBz5A49Q7Ry79r1FpwBSWJsjDfkXKDWDf16Xozw6Tl6HiETFSea /5+N01hlq/te0Elih7QSAC7uObbxJzFO0SRdSGn9uSK9L4/ImUeYWIKLkC+nQDyeSCzn 9mOB5W7GO/DyN1FvhdZ78M55URPhGEAc1f0oc0nVqTsfcZKOYawxyRrbcB82vmDKSO8x XBjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZqyQ7XMjYE5Lem5Esap5xk1ZCwQYIm+rQsYtC13GPlo=; b=ookmA64OxiHlaCC0Ew0R4w1k7sQVMf5k8/CvtztVtpe1t6AA/cRSJOAD0twUTBQYSC Kf/sh5foOPGaPSeN9ePpsHdrXtSorAr5OwaNgLqfPIZr35vCbMP7GJ0bfXVnSYNuKJT3 TLQGszP/7k+qhczS9rCjzgf0lqE35U+752CB7N9IFojH8IXiF3wYkSXFqx3Mh8k63B/X Q38crDtMCsjJyvedBUDHHz52LFMPSCHlPRK34xh/Rtrz+61MRARdsmbJ0szGXTK3gY/n wxsxx3+19Tr9iHowr9tK4H64zIFxdXx7eOWvK6cBj9ortMtt0td9ElD+qj2iqiKDtT+m n++Q== X-Gm-Message-State: AOAM531MgjDMk6yU9rI60y5SKjBdISrgzNPT71smx9GBdwjBPeXHpeNS taCTOalokMPCkhiXXduSaNk= X-Google-Smtp-Source: ABdhPJxPoyaiQgGTdXQaeEeo8qg6nDw742Z2Be3PonhHp4WXgXnuNIWgegzvPJ0RfUAgWkPIHUvgig== X-Received: by 2002:a5d:4bc6:: with SMTP id l6mr21196324wrt.53.1626095202401; Mon, 12 Jul 2021 06:06:42 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id y19sm1123825wma.21.2021.07.12.06.06.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:06:29 -0700 (PDT) From: luca.boccassi@gmail.com To: Hongbo Zheng Cc: Min Hu , David Marchand , dpdk stable Date: Mon, 12 Jul 2021 14:03:56 +0100 Message-Id: <20210712130551.2462159-1-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'graph: fix memory leak in stats' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/3d328cf711b9f6948a49d2258bc0809de30002e1 Thanks. Luca Boccassi --- >From 3d328cf711b9f6948a49d2258bc0809de30002e1 Mon Sep 17 00:00:00 2001 From: Hongbo Zheng Date: Thu, 6 May 2021 15:16:26 +0800 Subject: [PATCH] graph: fix memory leak in stats [ upstream commit 3b47572fbe783ced8264bc7de459121e201c5bef ] Fix function 'stats_mem_populate' return without free dynamic memory referenced by 'stats'. Fixes: af1ae8b6a32c ("graph: implement stats") Signed-off-by: Hongbo Zheng Signed-off-by: Min Hu (Connor) Reviewed-by: David Marchand --- lib/librte_graph/graph_stats.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librte_graph/graph_stats.c b/lib/librte_graph/graph_stats.c index 125e08d732..30e295d8b1 100644 --- a/lib/librte_graph/graph_stats.c +++ b/lib/librte_graph/graph_stats.c @@ -165,6 +165,7 @@ stats_mem_populate(struct rte_graph_cluster_stats **stats_in, stats = realloc(stats, stats->sz + stats->cluster_node_size); if (stats == NULL) SET_ERR_JMP(ENOMEM, err, "Realloc failed"); + *stats_in = NULL; /* Clear the new struct cluster_node area */ cluster = RTE_PTR_ADD(stats, stats->sz), @@ -174,7 +175,7 @@ stats_mem_populate(struct rte_graph_cluster_stats **stats_in, cluster->stat.hz = rte_get_timer_hz(); node = graph_node_id_to_ptr(graph, id); if (node == NULL) - SET_ERR_JMP(ENOENT, err, "Failed to find node %s in graph %s", + SET_ERR_JMP(ENOENT, free, "Failed to find node %s in graph %s", graph_node->node->name, graph->name); cluster->nodes[cluster->nb_nodes++] = node; @@ -183,6 +184,8 @@ stats_mem_populate(struct rte_graph_cluster_stats **stats_in, *stats_in = stats; return 0; +free: + free(stats); err: return -rte_errno; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:36.977376606 +0100 +++ 0001-graph-fix-memory-leak-in-stats.patch 2021-07-12 13:41:36.146115445 +0100 @@ -1 +1 @@ -From 3b47572fbe783ced8264bc7de459121e201c5bef Mon Sep 17 00:00:00 2001 +From 3d328cf711b9f6948a49d2258bc0809de30002e1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3b47572fbe783ced8264bc7de459121e201c5bef ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -16 +17 @@ - lib/graph/graph_stats.c | 5 ++++- + lib/librte_graph/graph_stats.c | 5 ++++- @@ -19 +20 @@ -diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c +diff --git a/lib/librte_graph/graph_stats.c b/lib/librte_graph/graph_stats.c @@ -21,2 +22,2 @@ ---- a/lib/graph/graph_stats.c -+++ b/lib/graph/graph_stats.c +--- a/lib/librte_graph/graph_stats.c ++++ b/lib/librte_graph/graph_stats.c