diff options
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/pat.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index b17cdf64e41e..277446cd30b6 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -510,7 +510,6 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
510 | { | 510 | { |
511 | u64 offset = ((u64) pfn) << PAGE_SHIFT; | 511 | u64 offset = ((u64) pfn) << PAGE_SHIFT; |
512 | unsigned long flags = _PAGE_CACHE_UC_MINUS; | 512 | unsigned long flags = _PAGE_CACHE_UC_MINUS; |
513 | unsigned long ret_flags; | ||
514 | int retval; | 513 | int retval; |
515 | 514 | ||
516 | if (!range_is_allowed(pfn, size)) | 515 | if (!range_is_allowed(pfn, size)) |
@@ -549,14 +548,12 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
549 | if (flags != _PAGE_CACHE_UC_MINUS) { | 548 | if (flags != _PAGE_CACHE_UC_MINUS) { |
550 | retval = reserve_memtype(offset, offset + size, flags, NULL); | 549 | retval = reserve_memtype(offset, offset + size, flags, NULL); |
551 | } else { | 550 | } else { |
552 | retval = reserve_memtype(offset, offset + size, -1, &ret_flags); | 551 | retval = reserve_memtype(offset, offset + size, -1, &flags); |
553 | } | 552 | } |
554 | 553 | ||
555 | if (retval < 0) | 554 | if (retval < 0) |
556 | return 0; | 555 | return 0; |
557 | 556 | ||
558 | flags = ret_flags; | ||
559 | |||
560 | if (pfn <= max_pfn_mapped && | 557 | if (pfn <= max_pfn_mapped && |
561 | ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) { | 558 | ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) { |
562 | free_memtype(offset, offset + size); | 559 | free_memtype(offset, offset + size); |