aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-09-17 22:11:34 -0700
committerYinghai Lu <yinghai@kernel.org>2012-09-17 22:11:34 -0700
commit01279eb4a19a8269d84d804dfa100e0f6d02a6eb (patch)
treea85a5ba6537c3c84f8f987fd063de31f1966ce62
parent332fd4a3ac4c54e2ab4d438b46a0fb4d7121f634 (diff)
downloadlinux-yinghai-01279eb4a19a8269d84d804dfa100e0f6d02a6eb.tar.gz
PCI, x86: clear initial value for root info resources
Found one system one root bus hot remove get panic. Panic happens when try to release hostbridge resource. It turns out that resource get reject during put into resource tree because of conflicts. Also that resource parent pointer have random value. That invalid value cause it pass through check __release_pci_root_info and panic in release_resource. Try to use kzalloc instead. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: x86@kernel.org
-rw-r--r--arch/x86/pci/acpi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 505acdd6d6001..192397c986066 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -305,7 +305,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
res->flags = flags;
res->start = start;
res->end = end;
- res->child = NULL;
if (!pci_use_crs) {
dev_printk(KERN_DEBUG, &info->bridge->dev,
@@ -434,7 +433,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
size = sizeof(*info->res) * info->res_num;
info->res_num = 0;
- info->res = kmalloc(size, GFP_KERNEL);
+ info->res = kzalloc(size, GFP_KERNEL);
if (!info->res)
return;