Message ID | 20221208190341.1560157-3-helgaas@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | e427132f7756d74e771c1f9309eb55598fa8c525 |
Headers | show |
Series | PCI: Continue E820 vs host bridge window saga | expand |
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 3cef835b375f..83ae838ceb5f 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -197,6 +197,10 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res, max = avail.end; + /* Don't bother if available space isn't large enough */ + if (size > max - min_used + 1) + continue; + /* Ok, try it out.. */ ret = allocate_resource(r, res, size, min_used, max, align, alignf, alignf_data);