diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-07-03 18:08:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:08:03 -0400 |
commit | bd9d43f47d6944019918a801398c587ee86c4b52 (patch) | |
tree | 56e2f0df4307e5562793b67a8efe7261f168acef /fs/exec.c | |
parent | 18c830df771f2ba8b4699fea9af1492275ae627b (diff) |
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/exec.c')
-rw-r--r-- | fs/exec.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1464,7 +1464,6 @@ static int do_execve_common(const char *filename, | |||
1464 | struct files_struct *displaced; | 1464 | struct files_struct *displaced; |
1465 | bool clear_in_exec; | 1465 | bool clear_in_exec; |
1466 | int retval; | 1466 | int retval; |
1467 | const struct cred *cred = current_cred(); | ||
1468 | 1467 | ||
1469 | /* | 1468 | /* |
1470 | * We move the actual failure in case of RLIMIT_NPROC excess from | 1469 | * We move the actual failure in case of RLIMIT_NPROC excess from |
@@ -1473,7 +1472,7 @@ static int do_execve_common(const char *filename, | |||
1473 | * whether NPROC limit is still exceeded. | 1472 | * whether NPROC limit is still exceeded. |
1474 | */ | 1473 | */ |
1475 | if ((current->flags & PF_NPROC_EXCEEDED) && | 1474 | if ((current->flags & PF_NPROC_EXCEEDED) && |
1476 | atomic_read(&cred->user->processes) > rlimit(RLIMIT_NPROC)) { | 1475 | atomic_read(¤t_user()->processes) > rlimit(RLIMIT_NPROC)) { |
1477 | retval = -EAGAIN; | 1476 | retval = -EAGAIN; |
1478 | goto out_ret; | 1477 | goto out_ret; |
1479 | } | 1478 | } |