posix-cpu-timer: Unify the now redundant code in lookup_task
[sfrench/cifs-2.6.git] / kernel / time / posix-cpu-timers.c
index e4051e417bcb8c799df8407e7d931c880ac54273..b7f972fb115ef38643ff81c3d2784242c833a34e 100644 (file)
@@ -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.