[dpdk-stable] patch 'bus/pci: fix memory leak when unmapping VFIO resource' has been queued to LTS release 18.11.11

Kevin Traynor ktraynor at redhat.com
Thu Nov 5 13:39:47 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/10/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/b27a0f085a793a178d054d01740d1fbe2720ce86

Thanks.

Kevin.

---
>From b27a0f085a793a178d054d01740d1fbe2720ce86 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Fri, 11 Sep 2020 18:57:42 +0800
Subject: [PATCH] bus/pci: fix memory leak when unmapping VFIO resource

[ upstream commit e34a43a6729dd33e430e1815a395893fe1c643d6 ]

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")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 drivers/bus/pci/linux/pci_vfio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index cf61032a5d..44a7c764ce 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -987,5 +987,5 @@ 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.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-05 12:38:55.022956248 +0000
+++ 0040-bus-pci-fix-memory-leak-when-unmapping-VFIO-resource.patch	2020-11-05 12:38:54.241896020 +0000
@@ -1 +1 @@
-From e34a43a6729dd33e430e1815a395893fe1c643d6 Mon Sep 17 00:00:00 2001
+From b27a0f085a793a178d054d01740d1fbe2720ce86 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit e34a43a6729dd33e430e1815a395893fe1c643d6 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index d2073994fa..940ebc1e35 100644
+index cf61032a5d..44a7c764ce 100644
@@ -22 +23 @@
-@@ -1016,5 +1016,5 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
+@@ -987,5 +987,5 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)



More information about the stable mailing list