summaryrefslogtreecommitdiff
path: root/kernel/bpf/task_iter.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-11 08:09:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-11 08:09:25 +0100
commit591afd6e5a5045a7c0fe3fc6a26c55d8030bbf9f (patch)
tree9028c6bdb3b5a2536b74deeaa4901f94ba7a3b84 /kernel/bpf/task_iter.c
parent59b26d2e96c473b7b65cfe19381444d034e91715 (diff)
parent7c53f6b671f4aba70ff15e1b05148b10d58c2837 (diff)
Merge 5.11-rc3 into char-misc-next
We need the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/bpf/task_iter.c')
-rw-r--r--kernel/bpf/task_iter.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c
index e73c07593024..175b7b42bfc4 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;
@@ -151,13 +151,14 @@ again:
curr_task = info->task;
curr_fd = info->fd;
} else {
- curr_task = task_seq_get_next(ns, &curr_tid, true);
- if (!curr_task) {
- info->task = NULL;
- return NULL;
- }
-
- /* set info->task and info->tid */
+ curr_task = task_seq_get_next(ns, &curr_tid, true);
+ if (!curr_task) {
+ info->task = NULL;
+ info->tid = curr_tid;
+ return NULL;
+ }
+
+ /* set info->task and info->tid */
info->task = curr_task;
if (curr_tid == info->tid) {
curr_fd = info->fd;