Commit 8d38f203 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

kernel/signal.c: change do_signal_stop/do_sigaction to use while_each_thread()

Change do_signal_stop() and do_sigaction() to avoid next_thread() and use
while_each_thread() instead.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Kees Cook <keescook@chromium.org>
Reviewed-by: default avatarSameer Nanda <snanda@chromium.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e1f3835
...@@ -2047,8 +2047,8 @@ static bool do_signal_stop(int signr) ...@@ -2047,8 +2047,8 @@ static bool do_signal_stop(int signr)
if (task_set_jobctl_pending(current, signr | gstop)) if (task_set_jobctl_pending(current, signr | gstop))
sig->group_stop_count++; sig->group_stop_count++;
for (t = next_thread(current); t != current; t = current;
t = next_thread(t)) { while_each_thread(current, t) {
/* /*
* Setting state to TASK_STOPPED for a group * Setting state to TASK_STOPPED for a group
* stop is always done with the siglock held, * stop is always done with the siglock held,
...@@ -3125,8 +3125,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact) ...@@ -3125,8 +3125,7 @@ int do_sigaction(int sig, struct k_sigaction *act, struct k_sigaction *oact)
rm_from_queue_full(&mask, &t->signal->shared_pending); rm_from_queue_full(&mask, &t->signal->shared_pending);
do { do {
rm_from_queue_full(&mask, &t->pending); rm_from_queue_full(&mask, &t->pending);
t = next_thread(t); } while_each_thread(current, t);
} while (t != current);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment