aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/syscalls.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-01-28 16:38:25 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-01-28 16:38:25 -0500
commit0ada0a73120c28cc432bcdbac061781465c2f48f (patch)
treed17cadd4ea47e25d9e48e7d409a39c84268fbd27 /arch/powerpc/kernel/syscalls.c
parent6016a363f6b56b46b24655bcfc0499b715851cf3 (diff)
parent92dcffb916d309aa01778bf8963a6932e4014d07 (diff)
Merge commit 'v2.6.33-rc5' into secretlab/test-devicetree
Diffstat (limited to 'arch/powerpc/kernel/syscalls.c')
-rw-r--r--arch/powerpc/kernel/syscalls.c15
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(&current->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(&current->mm->mmap_sem);
166 if (file)
167 fput(file);
168out: 155out:
169 return ret; 156 return ret;
170} 157}