summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-04-21 10:12:16 +0200
committerPaul Mundt <lethal@linux-sh.org>2009-04-21 10:12:16 +0200
commit4db25d496c09fdf094d52d11a90ae51f9ee473c6 (patch)
tree77ab8003db1d6ccbcf3a9acafad26002fba37b63 /arch/sh
parentsh: sh7723: Don't default enable the RTC clock. (diff)
parentsh: Fix mmap2 for handling differing PAGE_SIZEs. (diff)
downloadlinux-4db25d496c09fdf094d52d11a90ae51f9ee473c6.tar.xz
linux-4db25d496c09fdf094d52d11a90ae51f9ee473c6.zip
Merge branch 'sh/stable-updates' into sh/for-2.6.30
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/sys_sh.c9
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);
}