summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.ibm.com>2018-07-31 15:59:09 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2019-02-07 11:57:04 +0100
commite8e25a7718cf64701ddf7f7b2e31c79815b613f1 (patch)
tree4e1926129005ff10ced108712525611fbd1fc12e /arch/s390
parents390/mmap: take stack_guard_gap into account for mmap_base (diff)
downloadlinux-e8e25a7718cf64701ddf7f7b2e31c79815b613f1.tar.xz
linux-e8e25a7718cf64701ddf7f7b2e31c79815b613f1.zip
s390/pci: improve bar check
Improve the bar check in pci_iomap_range to cover functions for which we recognize more bars than what we can access due to AR restrictions. Signed-off-by: Sebastian Ott <sebott@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/pci/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index a966d7bfac57..353161c2e309 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -285,7 +285,7 @@ void __iomem *pci_iomap_range(struct pci_dev *pdev,
struct zpci_dev *zdev = to_zpci(pdev);
int idx;
- if (!pci_resource_len(pdev, bar))
+ if (!pci_resource_len(pdev, bar) || bar >= PCI_BAR_COUNT)
return NULL;
idx = zdev->bars[bar].map_idx;