aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorPallipadi, Venkatesh <venkatesh.pallipadi@intel.com>2010-02-24 16:43:55 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-03-01 17:28:48 -0500
commit4daa2a8093ecd1148270a1fc64e99f072b8c2901 (patch)
tree6cb7c892d1ec77caff89ce183172e5950f085201 /arch/x86
parent9e41a49aab88a5a6c8f4875bf10a5543bc321f2d (diff)
x86, pat: In rbt_memtype_check_insert(), update new->type only if valid
new->type should only change when there is a valid ret_type. Otherwise the requested type and return type should be same. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> LKML-Reference: <20100224214355.GA16431@linux-os.sc.intel.com> Tested-by: Jack Steiner <steiner@sgi.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/mm/pat_rbtree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c
index 9063f40b638b..07de4cb8cc30 100644
--- a/arch/x86/mm/pat_rbtree.c
+++ b/arch/x86/mm/pat_rbtree.c
@@ -223,7 +223,9 @@ int rbt_memtype_check_insert(struct memtype *new, unsigned long *ret_type)
223 new->type, ret_type); 223 new->type, ret_type);
224 224
225 if (!err) { 225 if (!err) {
226 new->type = *ret_type; 226 if (ret_type)
227 new->type = *ret_type;
228
227 memtype_rb_insert(&memtype_rbroot, new); 229 memtype_rb_insert(&memtype_rbroot, new);
228 } 230 }
229 return err; 231 return err;