]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fs/exec.c: do_execve_common(): use current_user()
authorOleg Nesterov <oleg@redhat.com>
Wed, 19 Jun 2013 00:08:23 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:27:42 +0000 (17:27 +1000)
Trivial cleanup.  do_execve_common() can use current_user() and avoid the
unnecessary "struct cred *cred" var.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/exec.c

index 00eaba7352fc0a44a8c9789220c43afb72927f2c..7ed107bc32a22c13059f21158d4dccddfd3d9c38 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1460,7 +1460,6 @@ static int do_execve_common(const char *filename,
        struct files_struct *displaced;
        bool clear_in_exec;
        int retval;
-       const struct cred *cred = current_cred();
 
        /*
         * We move the actual failure in case of RLIMIT_NPROC excess from
@@ -1469,7 +1468,7 @@ static int do_execve_common(const char *filename,
         * whether NPROC limit is still exceeded.
         */
        if ((current->flags & PF_NPROC_EXCEEDED) &&
-           atomic_read(&cred->user->processes) > rlimit(RLIMIT_NPROC)) {
+           atomic_read(&current_user()->processes) > rlimit(RLIMIT_NPROC)) {
                retval = -EAGAIN;
                goto out_ret;
        }