Commit acc7c2e0 authored by Konrad Rzeszutek's avatar Konrad Rzeszutek Committed by Greg Kroah-Hartman

[PATCH] PCI: fix memory leak in MMCONFIG error path

This a bit late (yours patch was posted about a year ago), but
a co-worker of spotted part of the code that looks like a memory
leak. Looking at the code it seems that pci_mmcfg_config should
be free-ed if MMCONFIG is above 4GB.

From: Konrad Rzeszutek <konradr@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4d15a177
...@@ -202,6 +202,8 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size) ...@@ -202,6 +202,8 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
if (mcfg->config[i].base_reserved) { if (mcfg->config[i].base_reserved) {
printk(KERN_ERR PREFIX printk(KERN_ERR PREFIX
"MMCONFIG not in low 4GB of memory\n"); "MMCONFIG not in low 4GB of memory\n");
kfree(pci_mmcfg_config);
pci_mmcfg_config_num = 0;
return -ENODEV; return -ENODEV;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment