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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:44:21 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/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.

Thanks.

Luca Boccassi

---
>From 03941a263cc287f42f73adac8a10a4b9032a2d5a 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 ba60e7ce99..5dcf15424c 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -1003,7 +1003,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.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:14.947159617 +0000
+++ 0102-bus-pci-fix-memory-leak-when-unmapping-VFIO-resource.patch	2020-10-28 10:35:11.656832261 +0000
@@ -1,13 +1,14 @@
-From e34a43a6729dd33e430e1815a395893fe1c643d6 Mon Sep 17 00:00:00 2001
+From 03941a263cc287f42f73adac8a10a4b9032a2d5a 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")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
@@ -16,10 +17,10 @@
  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 d2073994fa..940ebc1e35 100644
+index ba60e7ce99..5dcf15424c 100644
 --- a/drivers/bus/pci/linux/pci_vfio.c
 +++ b/drivers/bus/pci/linux/pci_vfio.c
-@@ -1015,7 +1015,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
+@@ -1003,7 +1003,7 @@ pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
  	}
  
  	TAILQ_REMOVE(vfio_res_list, vfio_res, next);


More information about the stable mailing list