Skip to contentSkip to conversation

x86/mmcfg: set pci_mmcfg_config_num to 0 on error path

PATCH In review Roger Pau Monne 2 participants 2 messages Apr 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mmcfg: set pci_mmcfg_config_num to 0 on error path

One error path of acpi_parse_mcfg doesn't set pci_mmcfg_config_num to zero, fix this.

---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>

---
 xen/arch/x86/x86_64/acpi_mmcfg.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/x86_64/acpi_mmcfg.c +1 -0
index a96d5e00de..650140eec5 100644
@@ -96,6 +96,7 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
     if (!pci_mmcfg_config) {
         printk(KERN_WARNING PREFIX
                "No memory for MCFG config tables\n");
+        pci_mmcfg_config_num = 0;
         return -ENOMEM;
     }
 
Signature · 7 lines
2.11.0 (Apple Git-81)


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 21.04.17 at 15:43, <[email protected]> wrote:

One error path of acpi_parse_mcfg doesn't set pci_mmcfg_config_num to zero, fix this.

xen/arch/x86/x86_64/acpi_mmcfg.c int __init acpi_parse_mcfg(struct acpi_table_header *header) · line 100

Quoted 8 lines
xen/arch/x86/x86_64/acpi_mmcfg.c +1 -0
@@ -96,6 +96,7 @@ int __init acpi_parse_mcfg(struct acpi_table_header *header)
     if (!pci_mmcfg_config) {
         printk(KERN_WARNING PREFIX
                "No memory for MCFG config tables\n");
+        pci_mmcfg_config_num = 0;
         return -ENOMEM;

This being a boot-time out-of-memory, I don't think this is important to have in 4.9, so I'll queue it for afterwards.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel