summaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/mm/mmap.c')
-rw-r--r--arch/sh/mm/mmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/sh/mm/mmap.c b/arch/sh/mm/mmap.c
index d2984fa42d3d..afeb710ec5c3 100644
--- a/arch/sh/mm/mmap.c
+++ b/arch/sh/mm/mmap.c
@@ -54,7 +54,8 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
/* We do not accept a shared mapping if it would violate
* cache aliasing constraints.
*/
- if ((flags & MAP_SHARED) && (addr & shm_align_mask))
+ if ((flags & MAP_SHARED) &&
+ ((addr - (pgoff << PAGE_SHIFT)) & shm_align_mask))
return -EINVAL;
return addr;
}