x86, pat: Fix memory leak in free_memtype
authorXiaotian Feng <dfeng@redhat.com>
Wed, 26 May 2010 01:51:10 +0000 (09:51 +0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 26 May 2010 18:26:04 +0000 (11:26 -0700)
commit20413f27163fb1b8b806c0c219dc95eae67c633a
treee40c22039a057bfed07598de0761deda166c8740
parentfe501f1e89cd460793152f500bf25d81d463515b
x86, pat: Fix memory leak in free_memtype

Reserve_memtype will allocate memory for new memtype, but
in free_memtype, after the memtype erased from rbtree, the
memory is not freed.

Changes since V1:
make rbt_memtype_erase return erased memtype so that
it can be freed in free_memtype.

[ hpa: not for -stable: 2.6.34 and earlier not affected ]

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
LKML-Reference: <1274838670-8731-1-git-send-email-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>
Acked-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/mm/pat.c
arch/x86/mm/pat_internal.h
arch/x86/mm/pat_rbtree.c