patch-2.4.0-test2 linux/arch/mips64/kernel/syscall.c

Next file: linux/arch/mips64/sgi-ip27/ip27-rtc.c
Previous file: linux/arch/mips64/config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/arch/mips64/kernel/syscall.c linux/arch/mips64/kernel/syscall.c
@@ -56,7 +56,6 @@
 	struct file * file = NULL;
 	unsigned long error = -EFAULT;
 
-	down(&current->mm->mmap_sem);
 	lock_kernel();
 	if (!(flags & MAP_ANONYMOUS)) {
 		error = -EBADF;
@@ -66,12 +65,13 @@
 	}
         flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
 
+	down(&current->mm->mmap_sem);
         error = do_mmap(file, addr, len, prot, flags, offset);
+	up(&current->mm->mmap_sem);
         if (file)
                 fput(file);
 out:
 	unlock_kernel();
-	up(&current->mm->mmap_sem);
 
 	return error;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)