diff options
Diffstat (limited to 'arch/powerpc/kernel/syscalls.c')
-rw-r--r-- | arch/powerpc/kernel/syscalls.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index c04832c4a02e..3370e62e43d4 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c | |||
@@ -140,7 +140,6 @@ static inline unsigned long do_mmap2(unsigned long addr, size_t len, | |||
140 | unsigned long prot, unsigned long flags, | 140 | unsigned long prot, unsigned long flags, |
141 | unsigned long fd, unsigned long off, int shift) | 141 | unsigned long fd, unsigned long off, int shift) |
142 | { | 142 | { |
143 | struct file * file = NULL; | ||
144 | unsigned long ret = -EINVAL; | 143 | unsigned long ret = -EINVAL; |
145 | 144 | ||
146 | if (!arch_validate_prot(prot)) | 145 | if (!arch_validate_prot(prot)) |
@@ -151,20 +150,8 @@ static inline unsigned long do_mmap2(unsigned long addr, size_t len, | |||
151 | goto out; | 150 | goto out; |
152 | off >>= shift; | 151 | off >>= shift; |
153 | } | 152 | } |
154 | |||
155 | ret = -EBADF; | ||
156 | if (!(flags & MAP_ANONYMOUS)) { | ||
157 | if (!(file = fget(fd))) | ||
158 | goto out; | ||
159 | } | ||
160 | |||
161 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
162 | 153 | ||
163 | down_write(¤t->mm->mmap_sem); | 154 | ret = sys_mmap_pgoff(addr, len, prot, flags, fd, off); |
164 | ret = do_mmap_pgoff(file, addr, len, prot, flags, off); | ||
165 | up_write(¤t->mm->mmap_sem); | ||
166 | if (file) | ||
167 | fput(file); | ||
168 | out: | 155 | out: |
169 | return ret; | 156 | return ret; |
170 | } | 157 | } |