* [PATCH] x86/PCI: fix boot-time memory leak
@ 2011-10-17 19:40 Bjorn Helgaas
2011-10-17 19:46 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2011-10-17 19:40 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
Cc: Bernd Schubert, linux-pci, linux-acpi, Simon Kirby,
Catalin Marinas
From: Catalin Marinas <catalin.marinas@arm.com>
If we're not using _CRS, the host bridge's bus name and resource structures
were allocated but never freed. This patch fixes that.
Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/x86/pci/acpi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 404f21a..bac9b94 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -239,9 +239,6 @@ static void add_resources(struct pci_root_info *info)
int i;
struct resource *res, *root, *conflict;
- if (!pci_use_crs)
- return;
-
coalesce_windows(info, IORESOURCE_MEM);
coalesce_windows(info, IORESOURCE_IO);
@@ -296,8 +293,11 @@ get_current_resources(struct acpi_device *device, int busnum,
acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
&info);
- add_resources(&info);
- return;
+ if (pci_use_crs) {
+ add_resources(&info);
+ return;
+ }
+ kfree(info.name);
name_alloc_fail:
kfree(info.res);
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] x86/PCI: fix boot-time memory leak
2011-10-17 19:40 [PATCH] x86/PCI: fix boot-time memory leak Bjorn Helgaas
@ 2011-10-17 19:46 ` Greg KH
2011-10-17 19:59 ` Bjorn Helgaas
0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2011-10-17 19:46 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bernd Schubert,
linux-pci, linux-acpi, Simon Kirby, Catalin Marinas
On Mon, Oct 17, 2011 at 01:40:37PM -0600, Bjorn Helgaas wrote:
> From: Catalin Marinas <catalin.marinas@arm.com>
>
> If we're not using _CRS, the host bridge's bus name and resource structures
> were allocated but never freed. This patch fixes that.
>
> Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> Reported-by: Simon Kirby <sim@hostway.ca>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Is this something for the 3.0-stable tree as well?
greg k-h
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/PCI: fix boot-time memory leak
2011-10-17 19:46 ` Greg KH
@ 2011-10-17 19:59 ` Bjorn Helgaas
2011-10-17 20:21 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2011-10-17 19:59 UTC (permalink / raw)
To: Greg KH
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bernd Schubert,
linux-pci, linux-acpi, Simon Kirby, Catalin Marinas
On Mon, Oct 17, 2011 at 1:46 PM, Greg KH <greg@kroah.com> wrote:
> On Mon, Oct 17, 2011 at 01:40:37PM -0600, Bjorn Helgaas wrote:
>> From: Catalin Marinas <catalin.marinas@arm.com>
>>
>> If we're not using _CRS, the host bridge's bus name and resource structures
>> were allocated but never freed. This patch fixes that.
>>
>> Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>> Reported-by: Simon Kirby <sim@hostway.ca>
>> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>
> Is this something for the 3.0-stable tree as well?
It could be applied to 3.0-stable, but it only fixes a boot-time leak
of a couple hundred bytes (approx 16-byte name + typically 4 56-byte
struct resources), so I don't think it qualifies as any kind of a
critical fix.
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/PCI: fix boot-time memory leak
2011-10-17 19:59 ` Bjorn Helgaas
@ 2011-10-17 20:21 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2011-10-17 20:21 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bernd Schubert,
linux-pci, linux-acpi, Simon Kirby, Catalin Marinas
On Mon, Oct 17, 2011 at 01:59:10PM -0600, Bjorn Helgaas wrote:
> On Mon, Oct 17, 2011 at 1:46 PM, Greg KH <greg@kroah.com> wrote:
> > On Mon, Oct 17, 2011 at 01:40:37PM -0600, Bjorn Helgaas wrote:
> >> From: Catalin Marinas <catalin.marinas@arm.com>
> >>
> >> If we're not using _CRS, the host bridge's bus name and resource structures
> >> were allocated but never freed. This patch fixes that.
> >>
> >> Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> >> Reported-by: Simon Kirby <sim@hostway.ca>
> >> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> >
> > Is this something for the 3.0-stable tree as well?
>
> It could be applied to 3.0-stable, but it only fixes a boot-time leak
> of a couple hundred bytes (approx 16-byte name + typically 4 56-byte
> struct resources), so I don't think it qualifies as any kind of a
> critical fix.
Ok, just wanted to check, thanks.
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] x86/PCI: fix boot-time memory leak
@ 2011-09-23 16:59 Bjorn Helgaas
2011-10-17 16:30 ` Bjorn Helgaas
0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2011-09-23 16:59 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
Cc: Bernd Schubert, linux-pci, linux-acpi, Simon Kirby,
Catalin Marinas
If we're not using _CRS, the host bridge's bus name and resource structures
were allocated but never freed. This patch fixes that.
Patch by Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/x86/pci/acpi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index c953302..6fdc90f 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -228,9 +228,6 @@ static void add_resources(struct pci_root_info *info)
int i;
struct resource *res, *root, *conflict;
- if (!pci_use_crs)
- return;
-
coalesce_windows(info, IORESOURCE_MEM);
coalesce_windows(info, IORESOURCE_IO);
@@ -285,8 +282,11 @@ get_current_resources(struct acpi_device *device, int busnum,
acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
&info);
- add_resources(&info);
- return;
+ if (pci_use_crs) {
+ add_resources(&info);
+ return;
+ }
+ kfree(info.name);
name_alloc_fail:
kfree(info.res);
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH] x86/PCI: fix boot-time memory leak
2011-09-23 16:59 Bjorn Helgaas
@ 2011-10-17 16:30 ` Bjorn Helgaas
2011-10-17 19:17 ` Yinghai Lu
0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2011-10-17 16:30 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
Cc: Bernd Schubert, linux-pci, linux-acpi, Simon Kirby,
Catalin Marinas
On Fri, Sep 23, 2011 at 10:59 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> If we're not using _CRS, the host bridge's bus name and resource structures
> were allocated but never freed. This patch fixes that.
>
> Patch by Catalin Marinas <catalin.marinas@arm.com>
>
> Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> Reported-by: Simon Kirby <sim@hostway.ca>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
> arch/x86/pci/acpi.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index c953302..6fdc90f 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -228,9 +228,6 @@ static void add_resources(struct pci_root_info *info)
> int i;
> struct resource *res, *root, *conflict;
>
> - if (!pci_use_crs)
> - return;
> -
> coalesce_windows(info, IORESOURCE_MEM);
> coalesce_windows(info, IORESOURCE_IO);
>
> @@ -285,8 +282,11 @@ get_current_resources(struct acpi_device *device, int busnum,
> acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
> &info);
>
> - add_resources(&info);
> - return;
> + if (pci_use_crs) {
> + add_resources(&info);
> + return;
> + }
> + kfree(info.name);
>
> name_alloc_fail:
> kfree(info.res);
>
>
Jesse, can you pick this up, or would you prefer it go via a different tree?
Bjorn
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] x86/PCI: fix boot-time memory leak
2011-10-17 16:30 ` Bjorn Helgaas
@ 2011-10-17 19:17 ` Yinghai Lu
2011-10-17 21:04 ` Catalin Marinas
0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2011-10-17 19:17 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Bernd Schubert,
linux-pci, linux-acpi, Simon Kirby, Catalin Marinas
On Mon, Oct 17, 2011 at 9:30 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Fri, Sep 23, 2011 at 10:59 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> If we're not using _CRS, the host bridge's bus name and resource structures
>> were allocated but never freed. This patch fixes that.
>>
>> Patch by Catalin Marinas <catalin.marinas@arm.com>
>>
>> Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
>> Reported-by: Simon Kirby <sim@hostway.ca>
>> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
is this patch from you or Catalin?
If it is from Catalin, you should use
From: Catalin Marinas <catalin.marinas@arm.com>
Yinghai
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] x86/PCI: fix boot-time memory leak
2011-10-17 19:17 ` Yinghai Lu
@ 2011-10-17 21:04 ` Catalin Marinas
0 siblings, 0 replies; 8+ messages in thread
From: Catalin Marinas @ 2011-10-17 21:04 UTC (permalink / raw)
To: Yinghai Lu
Cc: Bjorn Helgaas, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
Bernd Schubert, linux-pci@vger.kernel.org,
linux-acpi@vger.kernel.org, Simon Kirby
On Mon, Oct 17, 2011 at 08:17:12PM +0100, Yinghai Lu wrote:
> On Mon, Oct 17, 2011 at 9:30 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> > On Fri, Sep 23, 2011 at 10:59 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> >> If we're not using _CRS, the host bridge's bus name and resource structures
> >> were allocated but never freed. This patch fixes that.
> >>
> >> Patch by Catalin Marinas <catalin.marinas@arm.com>
> >>
> >> Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
> >> Reported-by: Simon Kirby <sim@hostway.ca>
> >> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>
> is this patch from you or Catalin?
>
> If it is from Catalin, you should use
>
> From: Catalin Marinas <catalin.marinas@arm.com>
I just proposed an alternative to the original patch but the full
investigation was done I think by Bjorn. I don't mind if I'm not the
author :)
--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-10-17 21:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17 19:40 [PATCH] x86/PCI: fix boot-time memory leak Bjorn Helgaas
2011-10-17 19:46 ` Greg KH
2011-10-17 19:59 ` Bjorn Helgaas
2011-10-17 20:21 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2011-09-23 16:59 Bjorn Helgaas
2011-10-17 16:30 ` Bjorn Helgaas
2011-10-17 19:17 ` Yinghai Lu
2011-10-17 21:04 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox