public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Jeff Garzik <jeff@garzik.org>
Cc: Andrew Morton <akpm@osdl.org>, Greg KH <greg@kroah.com>,
	Jim Paradis <jparadis@redhat.com>, Andi Kleen <ak@suse.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86[-64] PCI domain support
Date: Wed, 27 Sep 2006 09:28:17 +0200	[thread overview]
Message-ID: <200609270928.18378.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <20060926191508.GA6350@havoc.gtf.org>

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

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 #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-09-27  7:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26 19:15 [PATCH] x86[-64] PCI domain support Jeff Garzik
2006-09-26 20:23 ` Greg KH
2006-09-26 20:27   ` Andi Kleen
2006-09-26 20:44   ` Jeff Garzik
2006-09-27  4:40     ` Greg KH
2006-09-27  7:28 ` Rolf Eike Beer [this message]
2006-09-28  9:33 ` Muli Ben-Yehuda
2006-09-28  9:45   ` Jeff Garzik
2006-09-28 22:45     ` Muli Ben-Yehuda
2006-09-28 23:03       ` Jeff Garzik
2006-09-28 23:31         ` Muli Ben-Yehuda
2006-09-30  9:34           ` Muli Ben-Yehuda
2006-09-30 10:03             ` Jeff Garzik
2006-09-30 10:42               ` Muli Ben-Yehuda
2006-09-30 11:12                 ` Jeff Garzik
2006-09-30 11:41                 ` Jeff Garzik
2006-09-30 17:51                   ` [PATCH] x86-64: Calgary IOMMU: update to work with PCI domains Muli Ben-Yehuda
2006-10-01  3:41                     ` Jeff Garzik
2006-09-29 13:43       ` [PATCH] x86[-64] PCI domain support Jon Mason
2006-09-29 17:11         ` Muli Ben-Yehuda
2006-09-29 18:24           ` Jon Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609270928.18378.eike-kernel@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=jeff@garzik.org \
    --cc=jparadis@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox