diff options
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r-- | arch/mips/kernel/linux32.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 1a2793efdc4e..f042563c924f 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -67,28 +67,13 @@ SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len, | |||
67 | unsigned long, prot, unsigned long, flags, unsigned long, fd, | 67 | unsigned long, prot, unsigned long, flags, unsigned long, fd, |
68 | unsigned long, pgoff) | 68 | unsigned long, pgoff) |
69 | { | 69 | { |
70 | struct file * file = NULL; | ||
71 | unsigned long error; | 70 | unsigned long error; |
72 | 71 | ||
73 | error = -EINVAL; | 72 | error = -EINVAL; |
74 | if (pgoff & (~PAGE_MASK >> 12)) | 73 | if (pgoff & (~PAGE_MASK >> 12)) |
75 | goto out; | 74 | goto out; |
76 | pgoff >>= PAGE_SHIFT-12; | 75 | error = sys_mmap_pgoff(addr, len, prot, flags, fd, |
77 | 76 | pgoff >> (PAGE_SHIFT-12)); | |
78 | if (!(flags & MAP_ANONYMOUS)) { | ||
79 | error = -EBADF; | ||
80 | file = fget(fd); | ||
81 | if (!file) | ||
82 | goto out; | ||
83 | } | ||
84 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
85 | |||
86 | down_write(¤t->mm->mmap_sem); | ||
87 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
88 | up_write(¤t->mm->mmap_sem); | ||
89 | if (file) | ||
90 | fput(file); | ||
91 | |||
92 | out: | 77 | out: |
93 | return error; | 78 | return error; |
94 | } | 79 | } |