DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Bing Zhao <bingz@nvidia.com>,
	Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>,
	 Slava Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Maayan Kashani <mkashani@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH v3] net/mlx5: fix matcher object memory leak
Date: Wed, 3 Jul 2024 08:08:53 +0000	[thread overview]
Message-ID: <PH0PR12MB88004768E49BC098362F8024A4DD2@PH0PR12MB8800.namprd12.prod.outlook.com> (raw)
In-Reply-To: <DM4PR12MB5184EF946E1B8C48FD4E83C9D0DD2@DM4PR12MB5184.namprd12.prod.outlook.com>

Hi,

> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Wednesday, July 3, 2024 10:00
> To: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>; Dariusz
> Sosnowski <dsosnowski@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; Maayan
> Kashani <mkashani@nvidia.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH v3] net/mlx5: fix matcher object memory leak
> 
> Hi,
> 
> 
> > -----Original Message-----
> > From: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
> > Sent: Wednesday, July 3, 2024 4:15 AM
> > To: Dariusz Sosnowski <dsosnowski@nvidia.com>; Slava Ovsiienko
> > <viacheslavo@nvidia.com>; Bing Zhao <bingz@nvidia.com>; Ori Kam
> > <orika@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>; Matan
> Azrad
> > <matan@nvidia.com>; Maayan Kashani <mkashani@nvidia.com>
> > Cc: dev@dpdk.org; Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
> > Subject: [PATCH v3] net/mlx5: fix matcher object memory leak
> >
> > External email: Use caution opening links or attachments
> >
> >
> > This makes sure that the allocated matcher object is freed for all
> > branches that return NULL.
> >
> > Coverity issue: 426424
> > Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable
> > reconfigure")
> > Cc: mkashani@nvidia.com
> >
> > Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
> > ---
> > v3:
> > * changed commit message.
> > * fixed typos
> > v2:
> > * fixed Fixes and Cc tags.
> > ---
> >  drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> > b/drivers/net/mlx5/mlx5_flow_dv.c index d46beffd4c..8a0d58cb05 100644
> > --- a/drivers/net/mlx5/mlx5_flow_dv.c
> > +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> > @@ -12010,9 +12010,12 @@ flow_matcher_create_cb(void *tool_ctx, void
> > *cb_ctx)
> >                 items = *((const struct rte_flow_item **)(ctx->data2));
> >                 resource->matcher_object = mlx5dr_bwc_matcher_create
> >                                 (resource->group->tbl,
> > resource->priority, items);
> > -               if (!(resource->matcher_object))
> > +               if (!resource->matcher_object) {
> > +                       mlx5_free(resource);
> >                         return NULL;
> > +               }
> >  #else
> > +               mlx5_free(resource);
> >                 return NULL;
> >  #endif
> >         }
> > --
> > 2.43.0
> 
> Acked-by: Bing Zhao <bingz@nvidia.com>

Thank you for all the changes and the patch!

Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Best regards,
Dariusz Sosnowski

  reply	other threads:[~2024-07-03  8:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23 10:35 [PATCH] net/mlx5: fix memleak for resource object Mahmoud Maatuq
2024-06-24 13:59 ` Dariusz Sosnowski
2024-06-24 19:10   ` Mahmoud Maatouq
2024-07-01 18:04     ` Dariusz Sosnowski
2024-06-24 19:41 ` [PATCH v2] " Mahmoud Maatuq
2024-07-01 18:07   ` Dariusz Sosnowski
2024-07-02 20:14 ` [PATCH v3] net/mlx5: fix matcher object memory leak Mahmoud Maatuq
2024-07-03  8:00   ` Bing Zhao
2024-07-03  8:08     ` Dariusz Sosnowski [this message]
2024-07-04 10:34   ` Raslan Darawsheh

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=PH0PR12MB88004768E49BC098362F8024A4DD2@PH0PR12MB8800.namprd12.prod.outlook.com \
    --to=dsosnowski@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=mahmoudmatook.mm@gmail.com \
    --cc=matan@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@nvidia.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).