diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2009-11-13 19:34:03 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-24 18:29:03 -0500 |
commit | f7ca69848786bb99fdfafb511791b078c298438e (patch) | |
tree | 21276998b08fed3711b4a7feff1d427f92174192 /arch | |
parent | 463a5df175e3ceed684397ee2f8a3eb523d835a0 (diff) |
x86/PCI: MMCONFIG: reject MMCONFIG apertures at address zero
Since all MMCONFIG regions go through pci_mmconfig_add(), we can test the
address once there. If the caller supplies an address of zero, we never
insert it in the pci_mmcfg_config[] table, so no need to test it elsewhere.
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index a0cc4d2efb8a..067a2cfed15c 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -41,6 +41,9 @@ static __init struct acpi_mcfg_allocation *pci_mmconfig_add(int segment, | |||
41 | int new_num = pci_mmcfg_config_num + 1; | 41 | int new_num = pci_mmcfg_config_num + 1; |
42 | int i = pci_mmcfg_config_num; | 42 | int i = pci_mmcfg_config_num; |
43 | 43 | ||
44 | if (addr == 0) | ||
45 | return NULL; | ||
46 | |||
44 | new = kzalloc(sizeof(pci_mmcfg_config[0]) * new_num, GFP_KERNEL); | 47 | new = kzalloc(sizeof(pci_mmcfg_config[0]) * new_num, GFP_KERNEL); |
45 | if (!new) | 48 | if (!new) |
46 | return NULL; | 49 | return NULL; |
@@ -471,8 +474,7 @@ static void __init pci_mmcfg_reject_broken(int early) | |||
471 | typeof(pci_mmcfg_config[0]) *cfg; | 474 | typeof(pci_mmcfg_config[0]) *cfg; |
472 | int i; | 475 | int i; |
473 | 476 | ||
474 | if ((pci_mmcfg_config_num == 0) || | 477 | if (pci_mmcfg_config_num == 0) |
475 | (pci_mmcfg_config[0].address == 0)) | ||
476 | return; | 478 | return; |
477 | 479 | ||
478 | for (i = 0; i < pci_mmcfg_config_num; i++) { | 480 | for (i = 0; i < pci_mmcfg_config_num; i++) { |
@@ -616,8 +618,7 @@ static void __init __pci_mmcfg_init(int early) | |||
616 | 618 | ||
617 | pci_mmcfg_reject_broken(early); | 619 | pci_mmcfg_reject_broken(early); |
618 | 620 | ||
619 | if ((pci_mmcfg_config_num == 0) || | 621 | if (pci_mmcfg_config_num == 0) |
620 | (pci_mmcfg_config[0].address == 0)) | ||
621 | return; | 622 | return; |
622 | 623 | ||
623 | if (pci_mmcfg_arch_init()) | 624 | if (pci_mmcfg_arch_init()) |
@@ -649,8 +650,7 @@ static int __init pci_mmcfg_late_insert_resources(void) | |||
649 | */ | 650 | */ |
650 | if ((pci_mmcfg_resources_inserted == 1) || | 651 | if ((pci_mmcfg_resources_inserted == 1) || |
651 | (pci_probe & PCI_PROBE_MMCONF) == 0 || | 652 | (pci_probe & PCI_PROBE_MMCONF) == 0 || |
652 | (pci_mmcfg_config_num == 0) || | 653 | (pci_mmcfg_config_num == 0)) |
653 | (pci_mmcfg_config[0].address == 0)) | ||
654 | return 1; | 654 | return 1; |
655 | 655 | ||
656 | /* | 656 | /* |