Commit 4daa2a8093ecd1148270a1fc64e99f072b8c2901

Authored by Pallipadi, Venkatesh
Committed by H. Peter Anvin
1 parent 9e41a49aab

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>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

arch/x86/mm/pat_rbtree.c
... ... @@ -223,7 +223,9 @@
223 223 new->type, ret_type);
224 224  
225 225 if (!err) {
226   - new->type = *ret_type;
  226 + if (ret_type)
  227 + new->type = *ret_type;
  228 +
227 229 memtype_rb_insert(&memtype_rbroot, new);
228 230 }
229 231 return err;