Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119532
b: refs/heads/master
c: 4280e31
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Dec 2, 2008
1 parent 1d7e946 commit 1a839e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8005992836434cab6182c6147993d21442184c1
refs/heads/master: 4280e3126f641898f0ed1a931645373d3489e2a6
17 changes: 8 additions & 9 deletions trunk/arch/frv/kernel/sys_frv.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,21 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
int error = -EBADF;
struct file * file = NULL;

flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if (!(flags & MAP_ANONYMOUS)) {
file = fget(fd);
if (!file)
goto out;
}

/* As with sparc32, make sure the shift for mmap2 is constant
(12), no matter what PAGE_SIZE we have.... */

/* But unlike sparc32, don't just silently break if we're
trying to map something we can't */
if (pgoff & ((1<<(PAGE_SHIFT-12))-1))
if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1))
return -EINVAL;
pgoff >>= PAGE_SHIFT - 12;

pgoff >>= (PAGE_SHIFT - 12);
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if (!(flags & MAP_ANONYMOUS)) {
file = fget(fd);
if (!file)
goto out;
}

down_write(&current->mm->mmap_sem);
error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
Expand Down

0 comments on commit 1a839e9

Please sign in to comment.