diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index c4a1147d6162..5af67a377a66 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1344,7 +1344,7 @@ pci_alloc_resource(device_t dev, device_t child, int type, int *rid, break; case SYS_RES_IOPORT: case SYS_RES_MEMORY: - if (*rid < PCIR_MAPS + 4*cfg->nummaps) { + if (*rid < PCIR_BAR(cfg->nummaps)) { /* * Enable the I/O mode. We should * also be allocating resources