Skip to content

Commit

Permalink
x86/PCI: Clear host bridge aperture struct resource
Browse files Browse the repository at this point in the history
Use kzalloc() so the struct resource doesn't contain garbage in
fields we don't initialize.

[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: x86@kernel.org
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Sep 21, 2012
1 parent 817a268 commit 4cd8daf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 4cd8daf

Please sign in to comment.