fs/exec.c: do_execve_common(): use current_user()
authorOleg Nesterov <[email protected]>
Wed, 3 Jul 2013 22:08:34 +0000 (15:08 -0700)
committerLinus Torvalds <[email protected]>
Wed, 3 Jul 2013 23:08:03 +0000 (16:08 -0700)
Trivial cleanup.  do_execve_common() can use current_user() and avoid the
unnecessary "struct cred *cred" var.

Signed-off-by: Oleg Nesterov <[email protected]>
Cc: Vasiliy Kulikov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/exec.c

index 7619dddd56220aedf17d96037e94880097c00bd3..396aec2dae90472ae302f7a05d5ae2b14598643f 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1464,7 +1464,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
@@ -1473,7 +1472,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;
        }