s390/pci: fix bar check

Fix the check which bar space we should map to allow available bars only.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Sebastian Ott 2016-01-22 14:03:06 +01:00 committed by Martin Schwidefsky
parent c506fff3d3
commit c0cabaddee

View file

@ -270,7 +270,7 @@ void __iomem *pci_iomap_range(struct pci_dev *pdev,
struct zpci_dev *zdev = to_zpci(pdev);
int idx;
if ((bar & 7) != bar)
if (!pci_resource_len(pdev, bar))
return NULL;
idx = zdev->bars[bar].map_idx;