> -----Original Message----- > From: David Marchand [mailto:[email protected]] > Sent: Friday, July 3, 2020 3:23 PM > To: wangyunjian <[email protected]> > Cc: dev <[email protected]>; Jeff Guo <[email protected]>; Lilijun (Jerry) > <[email protected]>; xudingke <[email protected]>; dpdk stable > <[email protected]> > 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 <[email protected]> > wrote: > > > > From: Yunjian Wang <[email protected]> > > > > 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: [email protected] > > > > Signed-off-by: Yunjian Wang <[email protected]> > > --- > > 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

