aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Lemon <[email protected]>2020-12-18 10:50:31 -0800
committerDaniel Borkmann <[email protected]>2020-12-24 02:04:53 +0100
commita61daaf351da7c8493f2586437617d60c24350b0 (patch)
tree423747adcf3211c9b13bef6bd7b165b03b315ff8
parent69ca310f34168eae0ada434796bfc22fb4a0fa26 (diff)
bpf: Use thread_group_leader()
Instead of directly comparing task->tgid and task->pid, use the thread_group_leader() helper. This helps with readability, and there should be no functional change. Signed-off-by: Jonathan Lemon <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
-rw-r--r--kernel/bpf/task_iter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
index 8033ab19138a..dc4007f1843b 100644
--- a/kernel/bpf/task_iter.c
+++ b/kernel/bpf/task_iter.c
@@ -37,7 +37,7 @@ retry:
if (!task) {
++*tid;
goto retry;
- } else if (skip_if_dup_files && task->tgid != task->pid &&
+ } else if (skip_if_dup_files && !thread_group_leader(task) &&
task->files == task->group_leader->files) {
put_task_struct(task);
task = NULL;