DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yunjian Wang <yunjian.wang@foxmail.com>
To: dev@dpdk.org
Cc: anatoly.burakov@intel.com,
	Yunjian Wang <yunjian.wang@foxmail.com>,
	stable@dpdk.org
Subject: [dpdk-dev]  [PATCH] vfio: fix mem leak when unmapping resource
Date: Sun, 14 Jun 2020 21:59:59 +0800
Message-ID: <20200614140034.E5CDC49E0@dpdk.org> (raw)

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


             reply	other threads:[~2020-06-14 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 13:59 Yunjian Wang [this message]
2020-09-11 10:57 ` [dpdk-dev] [PATCH v2] " wangyunjian
2020-09-17 10:37   ` Burakov, Anatoly
2020-10-05  8:13   ` David Marchand
     [not found] <20200614140035.247D44C87@dpdk.org>
2020-06-29  9:56 ` [dpdk-dev] [PATCH] " David Marchand

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=20200614140034.E5CDC49E0@dpdk.org \
    --to=yunjian.wang@foxmail.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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

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