Skip to contentSkip to conversation

do_execve_common: use current_user()

PATCH New Oleg Nesterov 1 participant 1 message May 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 do_execve_common: use current_user()

Trivial cleanup. do_execve_common() can use current_user() and avoid the unnecessary "struct cred *cred" var.

---
 fs/exec.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
fs/exec.c +1 -2
index 6430195..13f9bb0 100644
@@ -1461,7 +1461,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
@@ -1470,7 +1469,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;
 	}
Signature · 1 line
1.5.5.1