mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-27 01:11:31 +00:00
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>
This commit is contained in:
parent
18c830df77
commit
bd9d43f47d
1 changed files with 1 additions and 2 deletions
|
|
@ -1464,7 +1464,6 @@ static int do_execve_common(const char *filename,
|
||||||
struct files_struct *displaced;
|
struct files_struct *displaced;
|
||||||
bool clear_in_exec;
|
bool clear_in_exec;
|
||||||
int retval;
|
int retval;
|
||||||
const struct cred *cred = current_cred();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We move the actual failure in case of RLIMIT_NPROC excess from
|
* 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.
|
* whether NPROC limit is still exceeded.
|
||||||
*/
|
*/
|
||||||
if ((current->flags & PF_NPROC_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;
|
retval = -EAGAIN;
|
||||||
goto out_ret;
|
goto out_ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue