DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Pavan Nikhilesh <pbhagavatula@marvell.com>,
	David Marchand <david.marchand@redhat.com>,
	 Thomas Monjalon <thomas@monjalon.net>
Cc: Jerin Jacob <jerinj@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	 Nithin Dabilpuram <ndabilpuram@marvell.com>,
	dpdk-dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] test/graph_perf: fix memory leaks
Date: Fri, 15 May 2020 10:56:32 +0530	[thread overview]
Message-ID: <CALBAE1OcNzY8PYGY-qDRqkQYQmCTYHPROR2KXStkMpuXq6fQeQ@mail.gmail.com> (raw)
In-Reply-To: <20200513205600.6584-1-pbhagavatula@marvell.com>

On Thu, May 14, 2020 at 2:26 AM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Fix memory leaks reported by coverity.
>
> Coverity issue: 358440, 358441, 358446.

The last dot can be removed when merging.


> Fixes: 61d77071ab99 ("test/graph: add performance tests")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>



> ---
>  app/test/test_graph_perf.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/app/test/test_graph_perf.c b/app/test/test_graph_perf.c
> index 3089fb24c..296d99a9d 100644
> --- a/app/test/test_graph_perf.c
> +++ b/app/test/test_graph_perf.c
> @@ -76,6 +76,8 @@ test_node_ctx_init(const struct rte_graph *graph, struct rte_node *node)
>         RTE_SET_USED(graph);
>
>         mz = rte_memzone_lookup(TEST_GRAPH_PERF_MZ);
> +       if (mz == NULL)
> +               return -ENOMEM;
>         graph_data = mz->addr;
>         node_data = graph_get_node_data(graph_data, nid);
>         node->ctx[0] = node->nb_edges;
> @@ -570,6 +572,7 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,
>         }
>         graph_data->graph_id = graph_id;
>
> +       free(node_map);
>         for (i = 0; i < graph_data->nb_nodes; i++)
>                 free(node_patterns[i]);
>         free(snk_nodes);
> @@ -578,6 +581,7 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks,
>         return 0;
>
>  pattern_name_free:
> +       free(node_map);
>         for (i = 0; i < graph_data->nb_nodes; i++)
>                 free(node_patterns[i]);
>  snk_free:
> @@ -677,6 +681,8 @@ measure_perf(void)
>         struct test_graph_perf *graph_data;
>
>         mz = rte_memzone_lookup(TEST_GRAPH_PERF_MZ);
> +       if (mz == NULL)
> +               return -ENOMEM;
>         graph_data = mz->addr;
>
>         return measure_perf_get(graph_data->graph_id);
> --
> 2.26.2
>

  reply	other threads:[~2020-05-15  5:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 20:56 pbhagavatula
2020-05-15  5:26 ` Jerin Jacob [this message]
2020-05-15  8:13 ` 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=CALBAE1OcNzY8PYGY-qDRqkQYQmCTYHPROR2KXStkMpuXq6fQeQ@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=thomas@monjalon.net \
    /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).