diff options
author | Venki Pallipadi <venkatesh.pallipadi@intel.com> | 2008-03-25 00:39:55 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 19:41:20 +0400 |
commit | dee7cbb210fdd266ad81af4689bcbac3649f38ff (patch) | |
tree | 2103ffc28bba2516003609026c649aa1e7592ad2 /arch/x86/pci/i386.c | |
parent | 9307cacad0dfe3749f00303125c6f7f0523e5616 (diff) | |
download | linux-dee7cbb210fdd266ad81af4689bcbac3649f38ff.tar.xz |
x86: PAT bug fix for attribute type check after reserve_memtype
Bug fixes for reserve_memtype() call in __ioremap and pci_mmap_page_range().
If reserve_memtype returns non-zero, then it is an error and subsequent free is
not required. Requested and returned prot value check should be done when
reserve_memtype returns success.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/pci/i386.c')
-rw-r--r-- | arch/x86/pci/i386.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 4ebf52f6b1fd..2ead72363077 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c @@ -328,6 +328,7 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, unsigned long len = vma->vm_end - vma->vm_start; unsigned long flags; unsigned long new_flags; + int retval; /* I/O space cannot be accessed via normal processor loads and * stores on this platform. @@ -344,7 +345,11 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, vma->vm_page_prot = __pgprot(prot); flags = pgprot_val(vma->vm_page_prot) & _PAGE_CACHE_MASK; - if (reserve_memtype(addr, addr + len, flags, &new_flags)) { + retval = reserve_memtype(addr, addr + len, flags, &new_flags); + if (retval) + return retval; + + if (flags != new_flags) { /* * Do not fallback to certain memory types with certain * requested type: |