summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-07-03 15:08:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 16:08:03 -0700
commitbd9d43f47d6944019918a801398c587ee86c4b52 (patch)
tree56e2f0df4307e5562793b67a8efe7261f168acef /fs
parent18c830df771f2ba8b4699fea9af1492275ae627b (diff)
downloadop-kernel-dev-bd9d43f47d6944019918a801398c587ee86c4b52.zip
op-kernel-dev-bd9d43f47d6944019918a801398c587ee86c4b52.tar.gz
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 <oleg@redhat.com> Cc: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/exec.c3
1 files changed, 1 insertions, 2 deletions
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(&current_user()->processes) > rlimit(RLIMIT_NPROC)) {
retval = -EAGAIN;
goto out_ret;
}
OpenPOWER on IntegriCloud