]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
do_sigaltstack: small cleanups
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Aug 2009 18:18:56 +0000 (11:18 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Aug 2009 18:18:56 +0000 (11:18 -0700)
The previous commit ("do_sigaltstack: avoid copying 'stack_t' as a
structure to user space") fixed a real bug.  This one just cleans up the
copy from user space to that gcc can generate better code for it (and so
that it looks the same as the later copy back to user space).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/signal.c

index f268372c0cc06a54430ea3a4e4dbe8fbf39e2fb7..64c5deeaca5d9a70f64f391bc73fde46e300bff1 100644 (file)
@@ -2464,10 +2464,12 @@ do_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, unsigned long s
                int ss_flags;
 
                error = -EFAULT;
-               if (!access_ok(VERIFY_READ, uss, sizeof(*uss))
-                   || __get_user(ss_sp, &uss->ss_sp)
-                   || __get_user(ss_flags, &uss->ss_flags)
-                   || __get_user(ss_size, &uss->ss_size))
+               if (!access_ok(VERIFY_READ, uss, sizeof(*uss)))
+                       goto out;
+               error = __get_user(ss_sp, &uss->ss_sp) |
+                       __get_user(ss_flags, &uss->ss_flags) |
+                       __get_user(ss_size, &uss->ss_size);
+               if (error)
                        goto out;
 
                error = -EPERM;