diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:48:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-12-11 06:48:57 -0500 |
commit | aa65607373a4daf2010e8c3867b6317619f3c1a3 (patch) | |
tree | 8a221e60d97cdfa2064df53f7da3061a18add7a2 /arch/score | |
parent | e77414e0aad6a1b063ba5e5750c582c75327ea6a (diff) |
Add missing alignment check in arch/score sys_mmap()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/score')
-rw-r--r-- | arch/score/kernel/sys_score.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c index 3d6a67dd628c..856ed68a58e6 100644 --- a/arch/score/kernel/sys_score.c +++ b/arch/score/kernel/sys_score.c | |||
@@ -41,10 +41,11 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | |||
41 | 41 | ||
42 | asmlinkage long | 42 | asmlinkage long |
43 | sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, | 43 | sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, |
44 | unsigned long flags, unsigned long fd, off_t pgoff) | 44 | unsigned long flags, unsigned long fd, off_t offset) |
45 | { | 45 | { |
46 | /* where's the alignment check? */ | 46 | if (unlikely(offset & ~PAGE_MASK)) |
47 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT); | 47 | return -EINVAL; |
48 | return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | ||
48 | } | 49 | } |
49 | 50 | ||
50 | asmlinkage long | 51 | asmlinkage long |