[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1009282333440.2416@localhost6.localdomain6>
Date: Tue, 28 Sep 2010 23:35:51 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Yinghai Lu <yinghai@...nel.org>
cc: Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Fwd: [PATCH] x86: Plug memory leak in sparse irq
On Tue, 28 Sep 2010, Yinghai Lu wrote:
> > From: Thomas Gleixner <tglx@...utronix.de>
> > Date: Tue, Sep 28, 2010 at 11:57 AM
> > Subject: [PATCH] x86: Plug memory leak in sparse irq
> > To: LKML <linux-kernel@...r.kernel.org>
> > Cc: x86@...nel.org, Yinghai Lu <yhlu.kernel@...il.com>
> >
> >
> > free_irq_cfg() is not freeing the cpumask_vars in irq_cfg.
> >
> > Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> > Cc: stable@...nel.org
> > ---
> > arch/x86/kernel/apic/io_apic.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > Index: linux-2.6/arch/x86/kernel/apic/io_apic.c
> > ===================================================================
> > --- linux-2.6.orig/arch/x86/kernel/apic/io_apic.c
> > +++ linux-2.6/arch/x86/kernel/apic/io_apic.c
> > @@ -311,9 +311,11 @@ void arch_init_copy_chip_data(struct irq
> > init_copy_irq_2_pin(old_cfg, cfg, node);
> > }
> >
> > -static void free_irq_cfg(struct irq_cfg *old_cfg)
> > +static void free_irq_cfg(struct irq_cfg *cfg)
> > {
> > - kfree(old_cfg);
> > + free_cpumask_var(cfg->domain);
> > + free_cpumask_var(cfg->old_domain);
> > + kfree(cfg);
> > }
> >
> > void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
>
> yes. still need
Was about to send that out next.
> [PATCH] x86: copy cpumask while copying chip_data for offstack cpumask
>
> While looking Thomas's
> | x86: Plug memory leak in sparse irq
>
> found copy_chip_data() could copy the cpumask pointers instead of real data.
> Need to use cpumask_copy there.
Sigh. That code should just depend on CONFIG_BROKEN, really.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists