From: Oleg Nesterov Date: Wed, 3 Jul 2013 22:08:34 +0000 (-0700) Subject: fs/exec.c: do_execve_common(): use current_user() X-Git-Tag: v3.11-rc1~99^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd9d43f47d6944019918a801398c587ee86c4b52;p=platform%2Fkernel%2Flinux-exynos.git fs/exec.c: do_execve_common(): use current_user() Trivial cleanup. do_execve_common() can use current_user() and avoid the unnecessary "struct cred *cred" var. Signed-off-by: Oleg Nesterov Cc: Vasiliy Kulikov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/exec.c b/fs/exec.c index 7619ddd..396aec2 100644 --- 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(¤t_user()->processes) > rlimit(RLIMIT_NPROC)) { retval = -EAGAIN; goto out_ret; }