diff options
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/sys_sh.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c index 58dfc02c7af1..e3a7e36639ef 100644 --- a/arch/sh/kernel/sys_sh.c +++ b/arch/sh/kernel/sys_sh.c | |||
@@ -63,6 +63,15 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | |||
63 | unsigned long prot, unsigned long flags, | 63 | unsigned long prot, unsigned long flags, |
64 | unsigned long fd, unsigned long pgoff) | 64 | unsigned long fd, unsigned long pgoff) |
65 | { | 65 | { |
66 | /* | ||
67 | * The shift for mmap2 is constant, regardless of PAGE_SIZE | ||
68 | * setting. | ||
69 | */ | ||
70 | if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1)) | ||
71 | return -EINVAL; | ||
72 | |||
73 | pgoff >>= PAGE_SHIFT - 12; | ||
74 | |||
66 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | 75 | return do_mmap2(addr, len, prot, flags, fd, pgoff); |
67 | } | 76 | } |
68 | 77 | ||