DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] efd: fix tailq entry leak in error path
@ 2020-09-29  3:31 wangyunjian
  2020-10-20 14:10 ` Thomas Monjalon
  2020-10-22 20:06 ` David Marchand
  0 siblings, 2 replies; 4+ messages in thread
From: wangyunjian @ 2020-09-29  3:31 UTC (permalink / raw)
  To: dev
  Cc: byron.marohn, yipeng1.wang, jerry.lilijun, xudingke,
	Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

In rte_efd_create() allocated memory for tailq entry, we should
free it when error happens, otherwise it will lead to memory leak.

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 lib/librte_efd/rte_efd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
index 6a799556d..0aa120f48 100644
--- a/lib/librte_efd/rte_efd.c
+++ b/lib/librte_efd/rte_efd.c
@@ -707,6 +707,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
 
 error_unlock_exit:
 	rte_mcfg_tailq_write_unlock();
+	rte_free(te);
 	rte_efd_free(table);
 
 	return NULL;
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path
  2020-09-29  3:31 [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path wangyunjian
@ 2020-10-20 14:10 ` Thomas Monjalon
  2020-10-20 20:24   ` Wang, Yipeng1
  2020-10-22 20:06 ` David Marchand
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2020-10-20 14:10 UTC (permalink / raw)
  To: byron.marohn, yipeng1.wang
  Cc: dev, jerry.lilijun, xudingke, Yunjian Wang, stable, wangyunjian

Byron, Yipeng,
Please could you review?
Thanks

29/09/2020 05:31, wangyunjian:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> In rte_efd_create() allocated memory for tailq entry, we should
> free it when error happens, otherwise it will lead to memory leak.
> 
> Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>  lib/librte_efd/rte_efd.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
> index 6a799556d..0aa120f48 100644
> --- a/lib/librte_efd/rte_efd.c
> +++ b/lib/librte_efd/rte_efd.c
> @@ -707,6 +707,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
>  
>  error_unlock_exit:
>  	rte_mcfg_tailq_write_unlock();
> +	rte_free(te);
>  	rte_efd_free(table);
>  
>  	return NULL;
> 






^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path
  2020-10-20 14:10 ` Thomas Monjalon
@ 2020-10-20 20:24   ` Wang, Yipeng1
  0 siblings, 0 replies; 4+ messages in thread
From: Wang, Yipeng1 @ 2020-10-20 20:24 UTC (permalink / raw)
  To: Thomas Monjalon, Marohn, Byron
  Cc: dev, jerry.lilijun, xudingke, Yunjian Wang, stable, wangyunjian

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, October 20, 2020 7:11 AM
> To: Marohn, Byron <byron.marohn@intel.com>; Wang, Yipeng1
> <yipeng1.wang@intel.com>
> Cc: dev@dpdk.org; jerry.lilijun@huawei.com; xudingke@huawei.com; Yunjian
> Wang <wangyunjian@huawei.com>; stable@dpdk.org; wangyunjian
> <wangyunjian@huawei.com>
> Subject: Re: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path
> 
> Byron, Yipeng,
> Please could you review?
> Thanks
> 
> 29/09/2020 05:31, wangyunjian:
> > From: Yunjian Wang <wangyunjian@huawei.com>
> >
> > In rte_efd_create() allocated memory for tailq entry, we should free
> > it when error happens, otherwise it will lead to memory leak.
> >
> > Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> >  lib/librte_efd/rte_efd.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index
> > 6a799556d..0aa120f48 100644
> > --- a/lib/librte_efd/rte_efd.c
> > +++ b/lib/librte_efd/rte_efd.c
> > @@ -707,6 +707,7 @@ rte_efd_create(const char *name, uint32_t
> > max_num_rules, uint32_t key_len,
> >
> >  error_unlock_exit:
> >  	rte_mcfg_tailq_write_unlock();
> > +	rte_free(te);
> >  	rte_efd_free(table);
> >
> >  	return NULL;
> >
[Wang, Yipeng] 
Thanks for the patch and sorry for the delay. The code looks good.
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path
  2020-09-29  3:31 [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path wangyunjian
  2020-10-20 14:10 ` Thomas Monjalon
@ 2020-10-22 20:06 ` David Marchand
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2020-10-22 20:06 UTC (permalink / raw)
  To: wangyunjian
  Cc: dev, Byron Marohn, Wang, Yipeng1, Lilijun (Jerry), xudingke, dpdk stable

On Tue, Sep 29, 2020 at 5:32 AM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> In rte_efd_create() allocated memory for tailq entry, we should
> free it when error happens, otherwise it will lead to memory leak.
>
> Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-22 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  3:31 [dpdk-dev] [PATCH] efd: fix tailq entry leak in error path wangyunjian
2020-10-20 14:10 ` Thomas Monjalon
2020-10-20 20:24   ` Wang, Yipeng1
2020-10-22 20:06 ` David Marchand

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git