lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 May 2013 15:58:03 +0800
From:	liguang <lig.fnst@...fujitsu.com>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	David Howells <dhowells@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Michael Kerrisk <mtk.manpages@...il.com>,
	Dave Jones <davej@...hat.com>,
	Kees Cook <keescook@...omium.org>,
	Cyrill Gorcunov <gorcunov@...nvz.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	liguang <lig.fnst@...fujitsu.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] sys: remove unnecesscary parameter of set_one_prio

Signed-off-by: liguang <lig.fnst@...fujitsu.com>
---
 kernel/sys.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index b95d3c7..07c6177 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -151,9 +151,9 @@ static bool set_one_prio_perm(struct task_struct *p)
  * set the priority of a task
  * - the caller must hold the RCU read lock
  */
-static int set_one_prio(struct task_struct *p, int niceval, int error)
+static int set_one_prio(struct task_struct *p, int niceval)
 {
-	int no_nice;
+	int no_nice, error = 0;
 
 	if (!set_one_prio_perm(p)) {
 		error = -EPERM;
@@ -168,8 +168,6 @@ static int set_one_prio(struct task_struct *p, int niceval, int error)
 		error = no_nice;
 		goto out;
 	}
-	if (error == -ESRCH)
-		error = 0;
 	set_user_nice(p, niceval);
 out:
 	return error;
@@ -203,7 +201,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
 			else
 				p = current;
 			if (p)
-				error = set_one_prio(p, niceval, error);
+				error = set_one_prio(p, niceval);
 			break;
 		case PRIO_PGRP:
 			if (who)
@@ -211,7 +209,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
 			else
 				pgrp = task_pgrp(current);
 			do_each_pid_thread(pgrp, PIDTYPE_PGID, p) {
-				error = set_one_prio(p, niceval, error);
+				error = set_one_prio(p, niceval);
 			} while_each_pid_thread(pgrp, PIDTYPE_PGID, p);
 			break;
 		case PRIO_USER:
@@ -225,7 +223,7 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
 
 			do_each_thread(g, p) {
 				if (uid_eq(task_uid(p), uid))
-					error = set_one_prio(p, niceval, error);
+					error = set_one_prio(p, niceval);
 			} while_each_thread(g, p);
 			if (!uid_eq(uid, cred->uid))
 				free_uid(user);		/* For find_user() */
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ