diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-04-21 17:12:16 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-21 17:12:16 +0900 |
commit | 4db25d496c09fdf094d52d11a90ae51f9ee473c6 (patch) | |
tree | 77ab8003db1d6ccbcf3a9acafad26002fba37b63 /arch/sh | |
parent | b8c193f88ebd8705b3e916532539031cd9fc0b4c (diff) | |
parent | 8c31813f31cd4403b46802866949a95a6e8fa584 (diff) |
Merge branch 'sh/stable-updates' into sh/for-2.6.30
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 58dfc02c7af..e3a7e36639e 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, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) { + /* + * The shift for mmap2 is constant, regardless of PAGE_SIZE + * setting. + */ + if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1)) + return -EINVAL; + + pgoff >>= PAGE_SHIFT - 12; + return do_mmap2(addr, len, prot, flags, fd, pgoff); } |