aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/pci/mmconfig-shared.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index fbadb89c71eb..7a7b6ba3abbb 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -554,6 +554,7 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
554static int __init pci_parse_mcfg(struct acpi_table_header *header) 554static int __init pci_parse_mcfg(struct acpi_table_header *header)
555{ 555{
556 struct acpi_table_mcfg *mcfg; 556 struct acpi_table_mcfg *mcfg;
557 struct acpi_mcfg_allocation *cfg_table, *cfg;
557 unsigned long i; 558 unsigned long i;
558 int entries, config_size; 559 int entries, config_size;
559 560
@@ -586,8 +587,10 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
586 memcpy(pci_mmcfg_config, &mcfg[1], config_size); 587 memcpy(pci_mmcfg_config, &mcfg[1], config_size);
587 pci_mmcfg_config_num = entries; 588 pci_mmcfg_config_num = entries;
588 589
590 cfg_table = (struct acpi_mcfg_allocation *) &mcfg[1];
589 for (i = 0; i < entries; i++) { 591 for (i = 0; i < entries; i++) {
590 if (acpi_mcfg_check_entry(mcfg, &pci_mmcfg_config[i])) { 592 cfg = &cfg_table[i];
593 if (acpi_mcfg_check_entry(mcfg, cfg)) {
591 kfree(pci_mmcfg_config); 594 kfree(pci_mmcfg_config);
592 pci_mmcfg_config_num = 0; 595 pci_mmcfg_config_num = 0;
593 return -ENODEV; 596 return -ENODEV;