DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Suanming Mou <suanmingm@nvidia.com>
Cc: Ori Kam <orika@nvidia.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	 Yuying Zhang <yuying.zhang@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	 Ferruh Yigit <ferruh.yigit@xilinx.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	 Ray Kinsella <mdr@ashroe.eu>,
	dev@dpdk.org
Subject: Re: [PATCH v1] ethdev: add indirect action async query
Date: Thu, 17 Nov 2022 09:06:40 +0100	[thread overview]
Message-ID: <CAJFAV8w4e4JBZcFhebxLBaRpq8=LK-RcDQP4Mdh_VUc_Y=ZF4w@mail.gmail.com> (raw)
In-Reply-To: <20220920071141.21769-1-suanmingm@nvidia.com>

Hello,

On Tue, Sep 20, 2022 at 9:12 AM Suanming Mou <suanmingm@nvidia.com> wrote:
> @@ -2873,17 +2907,23 @@ port_queue_action_handle_destroy(portid_t port_id,
>                          * of error.
>                          */
>                         memset(&error, 0x99, sizeof(error));
> +                       job = calloc(1, sizeof(*job));
> +                       if (!job) {
> +                               printf("Queue action destroy job allocate failed\n");
> +                               return -ENOMEM;
> +                       }
> +                       job->type = QUEUE_JOB_TYPE_ACTION_DESTROY;
> +                       job->pia = pia;
>
>                         if (pia->handle &&
>                             rte_flow_async_action_handle_destroy(port_id,
> -                               queue_id, &attr, pia->handle, NULL, &error)) {
> +                               queue_id, &attr, pia->handle, job, &error)) {
>                                 ret = port_flow_complain(&error);
>                                 continue;
>                         }
>                         *tmp = pia->next;
>                         printf("Indirect action #%u destruction queued\n",
>                                pia->id);
> -                       free(pia);
>                         break;
>                 }
>                 if (i == n)

Our covscan tool reports a potential leak of "job" in this block.
I am unclear whether it is a normal occurence, but it seems that if
pia->handle == NULL, then job is leaked.

Can you have a look and submit a fix if confirmed?

Thanks.


-- 
David Marchand


  parent reply	other threads:[~2022-11-17  8:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 13:28 [RFC] " Suanming Mou
2022-08-15 12:01 ` Ori Kam
2022-09-20  7:11 ` [PATCH v1] " Suanming Mou
2022-09-28  8:50   ` Andrew Rybchenko
2022-11-17  8:06   ` David Marchand [this message]
2022-11-17  8:18     ` Suanming Mou
2022-11-17  8:31       ` David Marchand
2022-11-17  8:40         ` Suanming Mou

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='CAJFAV8w4e4JBZcFhebxLBaRpq8=LK-RcDQP4Mdh_VUc_Y=ZF4w@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=mdr@ashroe.eu \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=yuying.zhang@intel.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).