patch-2.1.107 linux/arch/i386/kernel/sys_i386.c

Next file: linux/arch/i386/kernel/traps.c
Previous file: linux/arch/i386/kernel/smp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.106/linux/arch/i386/kernel/sys_i386.c linux/arch/i386/kernel/sys_i386.c
@@ -24,7 +24,7 @@
 
 /*
  * sys_pipe() is the normal C calling standard for creating
- * a pipe. It's not the way unix traditionally does this, though.
+ * a pipe. It's not the way Unix traditionally does this, though.
  */
 asmlinkage int sys_pipe(unsigned long * fildes)
 {
@@ -63,10 +63,11 @@
 	struct file * file = NULL;
 	struct mmap_arg_struct a;
 
+	if (copy_from_user(&a, arg, sizeof(a)))
+		return -EFAULT;
+
 	down(&current->mm->mmap_sem);
 	lock_kernel();
-	if (copy_from_user(&a, arg, sizeof(a)))
-		goto out;
 	if (!(a.flags & MAP_ANONYMOUS)) {
 		error = -EBADF;
 		file = fget(a.fd);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov