lkml.org 
[lkml]   [2006]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] x86[-64] PCI domain support
Date
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-09-27 09:31    [W:0.103 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site