summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2020-04-28 21:00:39 +0300
committerEric W. Biederman <ebiederm@xmission.com>2020-04-29 00:46:04 +0300
commitc7f5194054e103d18d267385b866b5b90511a425 (patch)
treeea8dcd9dbb0b0e83f67ba4f8ca2e1ac5707739a1 /kernel/time
parent8feebc6713cd78cbba8c4e2a6d92299669052026 (diff)
downloadlinux-c7f5194054e103d18d267385b866b5b90511a425.tar.xz
posix-cpu-timer: Unify the now redundant code in lookup_task
Now that both !thread paths through lookup_task call thread_group_leader, unify them into the single test at the end of lookup_task. This unification just makes it clear what is happening in the gettime special case of lookup_task. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/posix-cpu-timers.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index e4051e417bcb..b7f972fb115e 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -66,14 +66,13 @@ static struct task_struct *lookup_task(const pid_t pid, bool thread,
if (thread)
return same_thread_group(p, current) ? p : NULL;
- if (gettime) {
- /*
- * For clock_gettime(PROCESS) the task does not need to be
- * the actual group leader. task->signal gives
- * access to the group's clock.
- */
- return (p == current || thread_group_leader(p)) ? p : NULL;
- }
+ /*
+ * For clock_gettime(PROCESS) the task does not need to be
+ * the actual group leader. task->signal gives
+ * access to the group's clock.
+ */
+ if (gettime && (p == current))
+ return p;
/*
* For processes require that p is group leader.