diff options
Diffstat (limited to 'arch/x86/mm/pat.c')
-rw-r--r-- | arch/x86/mm/pat.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 281ac6489c08..a885a1019b8a 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -281,32 +281,24 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
281 | /* Search for existing mapping that overlaps the current range */ | 281 | /* Search for existing mapping that overlaps the current range */ |
282 | where = NULL; | 282 | where = NULL; |
283 | list_for_each_entry(entry, &memtype_list, nd) { | 283 | list_for_each_entry(entry, &memtype_list, nd) { |
284 | if (entry->start >= end) { | 284 | if (end <= entry->start) { |
285 | where = entry->nd.prev; | 285 | where = entry->nd.prev; |
286 | break; | 286 | break; |
287 | } | 287 | } else if (start <= entry->start) { /* end > entry->start */ |
288 | |||
289 | if (start <= entry->start && end >= entry->start) { | ||
290 | err = chk_conflict(new, entry, new_type); | 288 | err = chk_conflict(new, entry, new_type); |
291 | if (err) { | 289 | if (!err) { |
292 | break; | 290 | dprintk("Overlap at 0x%Lx-0x%Lx\n", |
291 | entry->start, entry->end); | ||
292 | where = entry->nd.prev; | ||
293 | } | 293 | } |
294 | |||
295 | dprintk("Overlap at 0x%Lx-0x%Lx\n", | ||
296 | entry->start, entry->end); | ||
297 | where = entry->nd.prev; | ||
298 | break; | 294 | break; |
299 | } | 295 | } else if (start < entry->end) { /* start > entry->start */ |
300 | |||
301 | if (start < entry->end) { | ||
302 | err = chk_conflict(new, entry, new_type); | 296 | err = chk_conflict(new, entry, new_type); |
303 | if (err) { | 297 | if (!err) { |
304 | break; | 298 | dprintk("Overlap at 0x%Lx-0x%Lx\n", |
299 | entry->start, entry->end); | ||
300 | where = &entry->nd; | ||
305 | } | 301 | } |
306 | |||
307 | dprintk("Overlap at 0x%Lx-0x%Lx\n", | ||
308 | entry->start, entry->end); | ||
309 | where = &entry->nd; | ||
310 | break; | 302 | break; |
311 | } | 303 | } |
312 | } | 304 | } |