diff options
author | Christian König <christian.koenig@amd.com> | 2017-11-29 09:12:27 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-12-06 15:57:19 -0500 |
commit | 470195f82e4ea550b7c37736a12bf3fa565295ea (patch) | |
tree | aaf23e0724734e83283c075114125c62df4838bb | |
parent | 7912af5c835bd86f2b0347a480e0f40e2fab30d0 (diff) |
x86/PCI: Fix infinite loop in search for 64bit BAR placement
Break the loop if we can't find some address space for a 64bit BAR.
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | arch/x86/pci/fixup.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 1e996df687a3..5328e86f73eb 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
@@ -696,8 +696,13 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev) | |||
696 | res->end = 0xfd00000000ull - 1; | 696 | res->end = 0xfd00000000ull - 1; |
697 | 697 | ||
698 | /* Just grab the free area behind system memory for this */ | 698 | /* Just grab the free area behind system memory for this */ |
699 | while ((conflict = request_resource_conflict(&iomem_resource, res))) | 699 | while ((conflict = request_resource_conflict(&iomem_resource, res))) { |
700 | if (conflict->end >= res->end) { | ||
701 | kfree(res); | ||
702 | return; | ||
703 | } | ||
700 | res->start = conflict->end + 1; | 704 | res->start = conflict->end + 1; |
705 | } | ||
701 | 706 | ||
702 | dev_info(&dev->dev, "adding root bus resource %pR\n", res); | 707 | dev_info(&dev->dev, "adding root bus resource %pR\n", res); |
703 | 708 | ||