diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 17:16:14 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 17:16:14 +0200 |
commit | 81ca98036985559c49480007371af94aa6e85dc0 (patch) | |
tree | 1d4f400a40b573d1405ccd0a7d869e9859a30408 /arch/sh/kernel/sys_sh.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vir... (diff) | |
parent | Merge branch 'sh/stable-updates' into sh/for-2.6.30 (diff) | |
download | linux-81ca98036985559c49480007371af94aa6e85dc0.tar.xz linux-81ca98036985559c49480007371af94aa6e85dc0.zip |
Merge branch 'sh/for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: Fix mmap2 for handling differing PAGE_SIZEs.
sh: sh7723: Don't default enable the RTC clock.
sh: sh7722: Don't default enable the RTC clock.
rtc: rtc-sh: clock framework support.
Diffstat (limited to 'arch/sh/kernel/sys_sh.c')
-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, 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); } |