Re: [PATCH] x86/PCI: fix boot-time memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 23, 2011 at 10:59 AM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> 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@xxxxxxx>
>
> Reported-by: Bernd Schubert <bernd.schubert@xxxxxxxxxxxxxxxxxx>
> Reported-by: Simon Kirby <sim@xxxxxxxxxx>
> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux