Skip to content

Commit 5b4427f

Browse files
Philipp Stannerjfvogel
authored andcommitted
PCI: Fix wrong length of devres array
commit f09d3937d400433080d17982bd1a540da53a156d upstream. 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/[email protected] Fixes: bbaff68 ("PCI: Add managed partial-BAR request and map infrastructure") Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Cc: [email protected] # v6.11+ Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 869202291aa47523d73a2ad9ef9ecfdeba0be5e5) Signed-off-by: Jack Vogel <[email protected]>
1 parent 6b74d43 commit 5b4427f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/devres.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* Legacy struct storing addresses to whole mapped BARs.
4141
*/
4242
struct pcim_iomap_devres {
43-
void __iomem *table[PCI_STD_NUM_BARS];
43+
void __iomem *table[PCI_NUM_RESOURCES];
4444
};
4545

4646
/* Used to restore the old INTx state on driver detach. */

0 commit comments

Comments
 (0)