From: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>,
Jerin Jacob <jerinj@marvell.com>,
"chcchc88@163.com" <chcchc88@163.com>,
Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
Zhirun Yan <yanzhirun_163@163.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Subject: RE: [PATCH v2] graph: fix memory leak in node clone
Date: Tue, 5 Nov 2024 13:34:25 +0000 [thread overview]
Message-ID: <PH0PR18MB5071B581E18882673D0968D9AC522@PH0PR18MB5071.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20241101073737.2003-1-pbhagavatula@marvell.com>
> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Friday, November 1, 2024 1:08 PM
> To: Jerin Jacob <jerinj@marvell.com>; chcchc88@163.com; Kiran Kumar
> Kokkilagadda <kirankumark@marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram@marvell.com>; Zhirun Yan <yanzhirun_163@163.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>
> Subject: [PATCH v2] graph: fix memory leak in node clone
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Free memory allocated for the node when xstats memory allocation fails.
>
> Coverity issue: 445529
> Fixes: 070db97e017b ("graph: support node xstats")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
Acked-by: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
> v2 Changes:
> - Fix one more leak. (Huichao cai)
>
> lib/graph/node.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/graph/node.c b/lib/graph/node.c index
> f15922892e..63db629da8 100644
> --- a/lib/graph/node.c
> +++ b/lib/graph/node.c
> @@ -156,7 +156,7 @@ node_clone(struct node *node, const char *name)
> (node->xstats->nb_xstats *
> RTE_NODE_XSTAT_DESC_SIZE));
> if (reg->xstats == NULL) {
> rte_errno = ENOMEM;
> - goto fail;
> + goto free;
> }
>
> for (i = 0; i < node->xstats->nb_xstats; i++) @@ -178,7 +178,7
> @@ node_clone(struct node *node, const char *name)
>
> /* Naming ceremony of the new node. name is node->name + "-" +
> name */
> if (clone_name(reg->name, node->name, name))
> - goto free;
> + goto free_xstat;
>
> rc = __rte_node_register(reg);
> free_xstat:
> --
> 2.25.1
prev parent reply other threads:[~2024-11-05 13:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 12:12 [PATCH] " pbhagavatula
2024-11-01 1:27 ` Huichao cai
2024-11-01 7:37 ` [PATCH v2] " pbhagavatula
2024-11-05 13:28 ` David Marchand
2024-11-06 20:21 ` David Marchand
2024-11-05 13:34 ` Kiran Kumar Kokkilagadda [this message]
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=PH0PR18MB5071B581E18882673D0968D9AC522@PH0PR18MB5071.namprd18.prod.outlook.com \
--to=kirankumark@marvell.com \
--cc=chcchc88@163.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=yanzhirun_163@163.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).