mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Fwd: [PATCH] x86: Plug memory leak in sparse irq
Date: Tue, 28 Sep 2010 23:35:51 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1009282333440.2416@localhost6.localdomain6> (raw)
In-Reply-To: <4CA25E5C.2020203@kernel.org>

On Tue, 28 Sep 2010, Yinghai Lu wrote:
> > From: Thomas Gleixner <tglx@linutronix.de>
> > Date: Tue, Sep 28, 2010 at 11:57 AM
> > Subject: [PATCH] x86: Plug memory leak in sparse irq
> > To: LKML <linux-kernel@vger.kernel.org>
> > Cc: x86@kernel.org, Yinghai Lu <yhlu.kernel@gmail.com>
> > 
> > 
> > free_irq_cfg() is not freeing the cpumask_vars in irq_cfg.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: stable@kernel.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

      reply	other threads:[~2010-09-28 21:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 18:57 Thomas Gleixner
     [not found] ` <AANLkTi=940qOigieOHd_cBcocBAb4AtYnm2v60i9CSmp@mail.gmail.com>
2010-09-28 21:30   ` Fwd: " Yinghai Lu
2010-09-28 21:35     ` Thomas Gleixner [this message]

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=alpine.LFD.2.00.1009282333440.2416@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=yinghai@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

all inboxes | Powered by JetHome®