From: David Marchand <david.marchand@redhat.com>
To: Yunjian Wang <yunjian.wang@foxmail.com>,
"Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: dev <dev@dpdk.org>, dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vfio: fix mem leak when unmapping resource
Date: Mon, 29 Jun 2020 11:56:14 +0200 [thread overview]
Message-ID: <CAJFAV8yXE2cNGJ87JihEHa9VVKJnfHpiRcPeS++=F4q34E_t9Q@mail.gmail.com> (raw)
In-Reply-To: <20200614140035.247D44C87@dpdk.org>
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
next parent reply other threads:[~2020-06-29 9:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200614140035.247D44C87@dpdk.org>
2020-06-29 9:56 ` David Marchand [this message]
2020-06-14 13:59 Yunjian Wang
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='CAJFAV8yXE2cNGJ87JihEHa9VVKJnfHpiRcPeS++=F4q34E_t9Q@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=yunjian.wang@foxmail.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).