diff options
Diffstat (limited to 'arch/x86/mm/pat_rbtree.c')
-rw-r--r-- | arch/x86/mm/pat_rbtree.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c index 07de4cb8cc30..f537087bb740 100644 --- a/arch/x86/mm/pat_rbtree.c +++ b/arch/x86/mm/pat_rbtree.c | |||
@@ -231,16 +231,17 @@ int rbt_memtype_check_insert(struct memtype *new, unsigned long *ret_type) | |||
231 | return err; | 231 | return err; |
232 | } | 232 | } |
233 | 233 | ||
234 | int rbt_memtype_erase(u64 start, u64 end) | 234 | struct memtype *rbt_memtype_erase(u64 start, u64 end) |
235 | { | 235 | { |
236 | struct memtype *data; | 236 | struct memtype *data; |
237 | 237 | ||
238 | data = memtype_rb_exact_match(&memtype_rbroot, start, end); | 238 | data = memtype_rb_exact_match(&memtype_rbroot, start, end); |
239 | if (!data) | 239 | if (!data) |
240 | return -EINVAL; | 240 | goto out; |
241 | 241 | ||
242 | rb_erase(&data->rb, &memtype_rbroot); | 242 | rb_erase(&data->rb, &memtype_rbroot); |
243 | return 0; | 243 | out: |
244 | return data; | ||
244 | } | 245 | } |
245 | 246 | ||
246 | struct memtype *rbt_memtype_lookup(u64 addr) | 247 | struct memtype *rbt_memtype_lookup(u64 addr) |