patches for DPDK stable branches
 help / color / Atom feed
* Re: [dpdk-stable] [dpdk-dev] [PATCH] vfio: fix mem leak when unmapping resource
       [not found] <20200614140035.247D44C87@dpdk.org>
@ 2020-06-29  9:56 ` David Marchand
  0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2020-06-29  9:56 UTC (permalink / raw)
  To: Yunjian Wang, Burakov, Anatoly; +Cc: dev, dpdk stable

On Sun, Jun 14, 2020 at 4:01 PM Yunjian Wang <yunjian.wang@foxmail.com> wrote:
>
> The 'vfio_res' is not freed when unmapping resource by primary process.
> This leads to memory leak.
>
> Fixes: ab53203e194b ("vfio: enable unmapping resource for secondary")
> Cc: stable@dpdk.org
>
> Signed-off-by: Yunjian Wang <yunjian.wang@foxmail.com>
> ---
>  drivers/bus/pci/linux/pci_vfio.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
> index 64cd84a68..bf4c3c1fa 100644
> --- a/drivers/bus/pci/linux/pci_vfio.c
> +++ b/drivers/bus/pci/linux/pci_vfio.c
> @@ -966,6 +966,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
>         }
>
>         TAILQ_REMOVE(vfio_res_list, vfio_res, next);
> +       rte_free(vfio_res);
>
>         return 0;
>  }
> --
> 2.18.1
>

Since this element is removed from the shared list, I guess no
secondary is using it anymore.
Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


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

* [dpdk-stable] [dpdk-dev] [PATCH] vfio: fix mem leak when unmapping resource
@ 2020-06-14 13:59 Yunjian Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Yunjian Wang @ 2020-06-14 13:59 UTC (permalink / raw)
  To: dev; +Cc: anatoly.burakov, Yunjian Wang, stable

The 'vfio_res' is not freed when unmapping resource by primary process.
This leads to memory leak.

Fixes: ab53203e194b ("vfio: enable unmapping resource for secondary")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <yunjian.wang@foxmail.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 64cd84a68..bf4c3c1fa 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -966,6 +966,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
 	}
 
 	TAILQ_REMOVE(vfio_res_list, vfio_res, next);
+	rte_free(vfio_res);
 
 	return 0;
 }
-- 
2.18.1


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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200614140035.247D44C87@dpdk.org>
2020-06-29  9:56 ` [dpdk-stable] [dpdk-dev] [PATCH] vfio: fix mem leak when unmapping resource David Marchand
2020-06-14 13:59 Yunjian Wang

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://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/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


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