patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [dpdk-dev] [PATCH] net/thunderx: fix memory leak when allocate rbdr desc ring fails
@ 2020-10-20 15:02 wangyunjian
  2020-10-31 13:18 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: wangyunjian @ 2020-10-20 15:02 UTC (permalink / raw)
  To: dev; +Cc: jerinj, mczekaj, jerry.lilijun, xudingke, Yunjian Wang, stable

From: Yunjian Wang <wangyunjian@huawei.com>

In nicvf_qset_rbdr_alloc(), we allocate memory for the 'rbdr'
structure but not released when allocate 'rbdr desc ring' fails.

Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/thunderx/nicvf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index f0bd20a22b..b6bb05e500 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -638,6 +638,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
 				      NICVF_RBDR_BASE_ALIGN_BYTES, nic->node);
 	if (rz == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to allocate mem for rbdr desc ring");
+		rte_free(rbdr);
 		return -ENOMEM;
 	}
 
-- 
2.23.0


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/thunderx: fix memory leak when allocate rbdr desc ring fails
  2020-10-20 15:02 [dpdk-stable] [dpdk-dev] [PATCH] net/thunderx: fix memory leak when allocate rbdr desc ring fails wangyunjian
@ 2020-10-31 13:18 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2020-10-31 13:18 UTC (permalink / raw)
  To: wangyunjian, Ferruh Yigit
  Cc: dpdk-dev, Jerin Jacob, Maciej Czekaj, Lilijun (Jerry),
	xudingke, dpdk stable

On Tue, Oct 20, 2020 at 8:33 PM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> In nicvf_qset_rbdr_alloc(), we allocate memory for the 'rbdr'
> structure but not released when allocate 'rbdr desc ring' fails.
>
> Fixes: 7413feee662d ("net/thunderx: add device start/stop and close")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>


Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-main. Thanks

> ---
>  drivers/net/thunderx/nicvf_ethdev.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
> index f0bd20a22b..b6bb05e500 100644
> --- a/drivers/net/thunderx/nicvf_ethdev.c
> +++ b/drivers/net/thunderx/nicvf_ethdev.c
> @@ -638,6 +638,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,
>                                       NICVF_RBDR_BASE_ALIGN_BYTES, nic->node);
>         if (rz == NULL) {
>                 PMD_INIT_LOG(ERR, "Failed to allocate mem for rbdr desc ring");
> +               rte_free(rbdr);
>                 return -ENOMEM;
>         }
>
> --
> 2.23.0
>

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

end of thread, other threads:[~2020-10-31 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 15:02 [dpdk-stable] [dpdk-dev] [PATCH] net/thunderx: fix memory leak when allocate rbdr desc ring fails wangyunjian
2020-10-31 13:18 ` Jerin Jacob

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/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 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

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


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