From: Sebastian Ott Date: Tue, 31 Jul 2018 13:59:09 +0000 (-0400) Subject: s390/pci: improve bar check X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e8e25a7718cf64701ddf7f7b2e31c79815b613f1;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Martin Schwidefsky --- 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;