patch 'bus/pci: fix variable shadowing' has been queued to stable release 23.11.7

Shani Peretz shperetz at nvidia.com
Tue Mar 31 08:23:41 CEST 2026


Hi,

FYI, your patch has been queued to stable release 23.11.7

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

This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/857b1e4861aaf59d582c85ef8de4ca078ef7ee9a

Thanks.

Shani

---
>From 857b1e4861aaf59d582c85ef8de4ca078ef7ee9a Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Wed, 14 Jan 2026 15:44:25 +0000
Subject: [PATCH] bus/pci: fix variable shadowing

[ upstream commit d061b3a53355b5976de45092fc853f0f46d8199e ]

Remove two instances where we had duplicate shadowed local variables
called "ret". In each case, we could just remove the inner instance,
since the outer value was not needing to be preserved.

Fixes: c0ce0577e84d ("pci: consolidate address comparisons")
Fixes: 03ba15ca65c1 ("vfio: allow mapping MSI-X BARs if kernel allows it")
Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/bus/pci/linux/pci.c      | 1 -
 drivers/bus/pci/linux/pci_vfio.c | 2 +-
 drivers/bus/pci/windows/pci.c    | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 3d237398d9..e568edb24f 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -332,7 +332,6 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
 		rte_pci_add_device(dev);
 	} else {
 		struct rte_pci_device *dev2;
-		int ret;
 
 		TAILQ_FOREACH(dev2, &rte_pci_bus.device_list, next) {
 			ret = rte_pci_addr_cmp(&dev->addr, &dev2->addr);
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 9341560fe5..a2cb1ea7d4 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -830,7 +830,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
 	}
 	/* if we found our MSI-X BAR region, check if we can mmap it */
 	if (vfio_res->msix_table.bar_index != -1) {
-		int ret = pci_vfio_msix_is_mappable(vfio_dev_fd,
+		ret = pci_vfio_msix_is_mappable(vfio_dev_fd,
 				vfio_res->msix_table.bar_index);
 		if (ret < 0) {
 			RTE_LOG(ERR, EAL, "Couldn't check if MSI-X BAR is mappable\n");
diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index 8deac2b35d..1398c89e5c 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -425,7 +425,6 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data)
 		rte_pci_add_device(dev);
 	} else {
 		struct rte_pci_device *dev2 = NULL;
-		int ret;
 
 		TAILQ_FOREACH(dev2, &rte_pci_bus.device_list, next) {
 			ret = rte_pci_addr_cmp(&dev->addr, &dev2->addr);
-- 
2.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-31 00:32:31.533358893 +0300
+++ 0022-bus-pci-fix-variable-shadowing.patch	2026-03-31 00:32:28.697331000 +0300
@@ -1 +1 @@
-From d061b3a53355b5976de45092fc853f0f46d8199e Mon Sep 17 00:00:00 2001
+From 857b1e4861aaf59d582c85ef8de4ca078ef7ee9a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit d061b3a53355b5976de45092fc853f0f46d8199e ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 66d7e09a6e..2ffac82e94 100644
+index 3d237398d9..e568edb24f 100644
@@ -28 +29 @@
-@@ -326,7 +326,6 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
+@@ -332,7 +332,6 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
@@ -37 +38 @@
-index 8562fdcc6b..242f567ed7 100644
+index 9341560fe5..a2cb1ea7d4 100644
@@ -40 +41 @@
-@@ -797,7 +797,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
+@@ -830,7 +830,7 @@ pci_vfio_map_resource_primary(struct rte_pci_device *dev)
@@ -48 +49 @@
- 			PCI_LOG(ERR, "Couldn't check if MSI-X BAR is mappable");
+ 			RTE_LOG(ERR, EAL, "Couldn't check if MSI-X BAR is mappable\n");
@@ -50 +51 @@
-index 6f6f368cb7..a5ce3b51f7 100644
+index 8deac2b35d..1398c89e5c 100644
@@ -53 +54 @@
-@@ -433,7 +433,6 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data)
+@@ -425,7 +425,6 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data)


More information about the stable mailing list