DPDK patches and discussions
 help / color / mirror / Atom feed
From: wangyunjian <wangyunjian@huawei.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, Jeff Guo <jia.guo@intel.com>,
	"Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
	xudingke <xudingke@huawei.com>, dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/2] eal: fix memory leak when removing event_cb
Date: Fri, 3 Jul 2020 07:52:12 +0000	[thread overview]
Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60D099075@dggemm513-mbx.china.huawei.com> (raw)
In-Reply-To: <CAJFAV8wdXsbxNhwbXiSw4JFk4ad33W8W28eJCx0z27smG+tGqA@mail.gmail.com>

> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Friday, July 3, 2020 3:23 PM
> To: wangyunjian <wangyunjian@huawei.com>
> Cc: dev <dev@dpdk.org>; Jeff Guo <jia.guo@intel.com>; Lilijun (Jerry)
> <jerry.lilijun@huawei.com>; xudingke <xudingke@huawei.com>; dpdk stable
> <stable@dpdk.org>
> Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v3 1/2] eal: fix memory leak when
> removing event_cb
> 
> On Thu, Jul 2, 2020 at 1:47 PM wangyunjian <wangyunjian@huawei.com>
> wrote:
> >
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > The event_cb->dev_name is not freed when freeing event_cb, and this
> > causes a memory leak.
> >
> > Fixes: a753e53d517b ("eal: add device event monitor framework")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> >  lib/librte_eal/common/eal_common_dev.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/lib/librte_eal/common/eal_common_dev.c
> > b/lib/librte_eal/common/eal_common_dev.c
> > index 9e4f09d..4cfdb80 100644
> > --- a/lib/librte_eal/common/eal_common_dev.c
> > +++ b/lib/librte_eal/common/eal_common_dev.c
> > @@ -526,6 +526,8 @@ static int cmp_dev_name(const struct rte_device
> *dev, const void *_name)
> >                  */
> >                 if (event_cb->active == 0) {
> >                         TAILQ_REMOVE(&dev_event_cbs, event_cb,
> next);
> > +                       if (event_cb->dev_name)
> > +                               free(event_cb->dev_name);
> 
> No need for the check, free handles a NULL pointer just fine.

Thanks for your suggestion, will send the v4 later.

> 
> Please, could you update your series/patches status in patchwork?
> I am a bit lost at what is superseded or not.

My mistake, please discard them.
https://patchwork.dpdk.org/patch/70824/
https://patchwork.dpdk.org/patch/70825/
https://patchwork.dpdk.org/patch/70826/
https://patchwork.dpdk.org/patch/72452/
https://patchwork.dpdk.org/patch/72825/
https://patchwork.dpdk.org/patch/72826/

Thanks,
Yunjian

> 
> 
> Thanks.
> 
> --
> David Marchand


  reply	other threads:[~2020-07-03  7:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 12:33 [dpdk-dev] [PATCH 0/3] fixes for device event wangyunjian
2020-06-03 12:54 ` wangyunjian
2020-06-03 12:54 ` [dpdk-dev] [PATCH 1/3] eal: fix memory leak when removing event_cb wangyunjian
2020-06-03 12:55 ` [dpdk-dev] [PATCH 2/3] eal: fix remove incorrect event_cb wangyunjian
2020-06-12  5:56   ` Jeff Guo
2020-06-30 11:29     ` wangyunjian
2020-06-30 11:56   ` [dpdk-dev] [PATCH v2] eal: fix memory leak when removing event_cb wangyunjian
2020-07-02  9:28     ` Jeff Guo
2020-07-02 10:53       ` wangyunjian
2020-07-02 11:46   ` [dpdk-dev] [PATCH v3 0/2] fixes for device event wangyunjian
2020-07-02 11:47   ` [dpdk-dev] [PATCH v3 1/2] eal: fix memory leak when removing event_cb wangyunjian
2020-07-03  6:04     ` Jeff Guo
2020-07-03  7:00       ` wangyunjian
2020-07-03  7:23     ` [dpdk-dev] [dpdk-stable] " David Marchand
2020-07-03  7:52       ` wangyunjian [this message]
2020-07-03  8:01         ` David Marchand
2020-07-02 11:47   ` [dpdk-dev] [PATCH v3 2/2] eal: return error code when failure wangyunjian
2020-06-03 12:55 ` [dpdk-dev] [PATCH 3/3] " wangyunjian
2020-07-02  9:18   ` Jeff Guo
2020-07-02 10:43     ` wangyunjian

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=34EFBCA9F01B0748BEB6B629CE643AE60D099075@dggemm513-mbx.china.huawei.com \
    --to=wangyunjian@huawei.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerry.lilijun@huawei.com \
    --cc=jia.guo@intel.com \
    --cc=stable@dpdk.org \
    --cc=xudingke@huawei.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).