Jeff Garzik wrote: > diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c > index b33aea8..e4f4828 100644 > --- a/arch/i386/pci/acpi.c > +++ b/arch/i386/pci/acpi.c > @@ -8,20 +8,37 @@ #include "pci.h" > struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, > int domain, int busnum) { > struct pci_bus *bus; > + struct pci_sysdata *sd; > > + /* Allocate per-root-bus (not per bus) arch-specific data. > + * TODO: leak; this memory is never freed. > + * It's arguable whether it's worth the trouble to care. > + */ > + sd = kzalloc(sizeof(*sd), GFP_KERNEL); > + if (!sd) { > + printk(KERN_ERR "PCI: OOM, not probing PCI bus %02x\n", busnum); > + return NULL; > + } > + > +#ifdef CONFIG_PCI_DOMAINS > + sd->domain = domain; > +#else > if (domain != 0) { > printk(KERN_WARNING "PCI: Multiple domains not supported\n"); kfree(sd); > return NULL; > } > +#endif /* CONFIG_PCI_DOMAINS */ I would move this check to be done before the memory is allocated so we don't need to free it. Eike
Attachment:
pgpdEJVKrnZAe.pgp
Description: PGP signature
- References:
- [PATCH] x86[-64] PCI domain support
- From: Jeff Garzik <[email protected]>
- [PATCH] x86[-64] PCI domain support
- Prev by Date: Re: Bad page state with x86_64
- Next by Date: Re: [PATCH] move put_task_struct() reaping into a thread [Re: 2.6.18-rt1]
- Previous by thread: Re: [PATCH] x86[-64] PCI domain support
- Next by thread: Re: [PATCH] x86[-64] PCI domain support
- Index(es):