DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
To: "Min Hu (Connor)" <humin29@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: Re: [dpdk-dev] [EXT] [PATCH 1/2] graph: fix memory leak
Date: Fri, 23 Apr 2021 03:52:08 +0000	[thread overview]
Message-ID: <BYAPR18MB2965ADC85D987CA0B8BCE1C7AC459@BYAPR18MB2965.namprd18.prod.outlook.com> (raw)
In-Reply-To: <1619092340-4047-2-git-send-email-humin29@huawei.com>



> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 22, 2021 5:22 PM
> To: dev@dpdk.org
> Cc: ferruh.yigit@intel.com; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
> Subject: [EXT] [PATCH 1/2] graph: fix memory leak
> 
> External Email
> 
> ----------------------------------------------------------------------
> From: HongBo Zheng <zhenghongbo3@huawei.com>
> 
> Fix function 'stats_mem_populate' return without free dynamic memory
> referenced by 'stats'.
> 
> Fixes: af1ae8b6a32c ("graph: implement stats")
> Cc: stable@dpdk.org
> 
> Signed-off-by: HongBo Zheng <zhenghongbo3@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  lib/librte_graph/graph_stats.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_graph/graph_stats.c b/lib/librte_graph/graph_stats.c index
> 125e08d..f698bb3 100644
> --- a/lib/librte_graph/graph_stats.c
> +++ b/lib/librte_graph/graph_stats.c
> @@ -174,7 +174,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 +183,8 @@ stats_mem_populate(struct rte_graph_cluster_stats
> **stats_in,
>  	*stats_in = stats;
> 
>  	return 0;
> +free:
> +	free(stats);
>  err:
>  	return -rte_errno;
>  }
> --
> 2.7.4


Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>


  reply	other threads:[~2021-04-23  3:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 11:52 [dpdk-dev] [PATCH 0/2] bugfix for graph Min Hu (Connor)
2021-04-22 11:52 ` [dpdk-dev] [PATCH 1/2] graph: fix memory leak Min Hu (Connor)
2021-04-23  3:52   ` Kiran Kumar Kokkilagadda [this message]
2021-05-04 14:15   ` David Marchand
2021-05-06  7:18     ` Min Hu (Connor)
2021-04-22 11:52 ` [dpdk-dev] [PATCH 2/2] graph: fix dereferencing null pointer Min Hu (Connor)
2021-04-23  3:52   ` [dpdk-dev] [EXT] " Kiran Kumar Kokkilagadda
2021-04-23  9:05   ` [dpdk-dev] " Jerin Jacob
2021-05-06  7:16 ` [dpdk-dev] [PATCH v2 0/2] bugfix for graph Min Hu (Connor)
2021-05-06  7:16   ` [dpdk-dev] [PATCH v2 1/2] graph: fix memory leak Min Hu (Connor)
2021-05-10 13:26     ` David Marchand
2021-05-06  7:16   ` [dpdk-dev] [PATCH v2 2/2] graph: fix dereferencing null pointer Min Hu (Connor)
2021-05-06  9:01     ` Jerin Jacob
2021-05-10 13:27     ` David Marchand
2021-06-03 16:40   ` [dpdk-dev] [PATCH v2 0/2] bugfix for graph David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR18MB2965ADC85D987CA0B8BCE1C7AC459@BYAPR18MB2965.namprd18.prod.outlook.com \
    --to=kirankumark@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=humin29@huawei.com \
    --cc=jerinj@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).