From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Xiaotian Feng <dfeng@redhat.com>
Cc: "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
Jack Steiner <steiner@sgi.com>,
Venkatesh Pallipadi <venki@google.com>
Subject: Re: [PATCH] x86/pat: fix memory leak in free_memtype
Date: Tue, 25 May 2010 17:27:32 -0700 [thread overview]
Message-ID: <1274833652.2892.579.camel@sbs-t61.sc.intel.com> (raw)
In-Reply-To: <1274832742.2892.549.camel@sbs-t61.sc.intel.com>
On Tue, 2010-05-25 at 17:12 -0700, Suresh Siddha wrote:
> On Tue, 2010-05-25 at 02:52 -0700, Xiaotian Feng wrote:
> > reserve_memtype will allocate memory for new memtype, but
> > in free_memtype, after the memtype erased from rbtree, the
> > memory is not freed.
> >
> > Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
> > Cc: Jack Steiner <steiner@sgi.com>
> > Cc: Suresh Siddha <suresh.b.siddha@intel.com>
> > ---
> > arch/x86/mm/pat_rbtree.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c
> > index 07de4cb..fb8c1e5 100644
> > --- a/arch/x86/mm/pat_rbtree.c
> > +++ b/arch/x86/mm/pat_rbtree.c
> > @@ -15,6 +15,7 @@
> > #include <linux/rbtree.h>
> > #include <linux/sched.h>
> > #include <linux/gfp.h>
> > +#include <linux/slab.h>
> >
> > #include <asm/pgtable.h>
> > #include <asm/pat.h>
> > @@ -240,6 +241,7 @@ int rbt_memtype_erase(u64 start, u64 end)
> > return -EINVAL;
> >
> > rb_erase(&data->rb, &memtype_rbroot);
> > + kfree(data);
> > return 0;
> > }
>
> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
>
> Peter, Please apply this for x86/urgent, this is introduced in the post
> 2.6.34 changes.
Xiaotian, Also I think more cleaner fix is to do this in free_memtype().
Can you please resend the patch with this change?
thanks,
suresh
next prev parent reply other threads:[~2010-05-26 0:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 9:52 Xiaotian Feng
2010-05-26 0:12 ` Suresh Siddha
2010-05-26 0:27 ` Suresh Siddha [this message]
2010-05-26 1:51 ` [PATCH V2] " Xiaotian Feng
2010-05-26 16:47 ` Suresh Siddha
2010-05-26 20:22 ` [tip:x86/urgent] x86, pat: Fix " tip-bot for Xiaotian Feng
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=1274833652.2892.579.camel@sbs-t61.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=dfeng@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=steiner@sgi.com \
--cc=tglx@linutronix.de \
--cc=venki@google.com \
--cc=x86@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®