[PATCH 04/11] PCI: Fix off-by-one in CardBus resource names

From: Ilpo Järvinen

Date: Mon Nov 09 2026 - 16:08:36 EST


cardbus_name[] in pci_resource_name() has no entry for resource index 6
(PCI_ROM_RESOURCE). As a result, all names after it are off by one: the
last non-window resource is named "CardBus bridge window 0", each
CardBus bridge window is given the name of the preceding window, and
PCI_CB_BRIDGE_MEM_1_WINDOW falls outside the array.

Add the missing entry.

Fixes: 65f8e0beac5a ("PCI: Update BAR # and window messages")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
drivers/pci/pci.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7c6f2aba8144..46da873c9aac 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -839,6 +839,7 @@ const char *pci_resource_name(struct pci_dev *dev, unsigned int i)
"unknown",
"unknown",
"unknown",
+ "unknown",
#ifdef CONFIG_PCI_IOV
"unknown",
"unknown",
--
2.47.3