]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Fix wrong length of devres array
authorPhilipp Stanner <phasta@kernel.org>
Wed, 12 Mar 2025 08:06:34 +0000 (09:06 +0100)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Fri, 14 Mar 2025 09:22:24 +0000 (09:22 +0000)
commitf09d3937d400433080d17982bd1a540da53a156d
tree347803d595795367ab3dab330988ade84925eb8a
parent2014c95afecee3e76ca4a56956a936e23283f05b
PCI: Fix wrong length of devres array

The array for the iomapping cookie addresses has a length of
PCI_STD_NUM_BARS. This constant, however, only describes standard BARs;
while PCI can allow for additional, special BARs.

The total number of PCI resources is described by constant
PCI_NUM_RESOURCES, which is also used in, e.g., pci_select_bars().

Thus, the devres array has so far been too small.

Change the length of the devres array to PCI_NUM_RESOURCES.

Link: https://lore.kernel.org/r/20250312080634.13731-3-phasta@kernel.org
Fixes: bbaff68bf4a4 ("PCI: Add managed partial-BAR request and map infrastructure")
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Cc: stable@vger.kernel.org # v6.11+
drivers/pci/devres.c