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>

authored by Pallipadi, Venkatesh and committed by H. Peter Anvin 4daa2a80 9e41a49a

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