diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/signal.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 5630255d2e2a..ea4632bd40a0 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1119,19 +1119,18 @@ kill_pg_info(int sig, struct siginfo *info, pid_t pgrp) | |||
1119 | int kill_pid_info(int sig, struct siginfo *info, struct pid *pid) | 1119 | int kill_pid_info(int sig, struct siginfo *info, struct pid *pid) |
1120 | { | 1120 | { |
1121 | int error; | 1121 | int error; |
1122 | int acquired_tasklist_lock = 0; | ||
1123 | struct task_struct *p; | 1122 | struct task_struct *p; |
1124 | 1123 | ||
1125 | rcu_read_lock(); | 1124 | rcu_read_lock(); |
1126 | if (unlikely(sig_needs_tasklist(sig))) { | 1125 | if (unlikely(sig_needs_tasklist(sig))) |
1127 | read_lock(&tasklist_lock); | 1126 | read_lock(&tasklist_lock); |
1128 | acquired_tasklist_lock = 1; | 1127 | |
1129 | } | ||
1130 | p = pid_task(pid, PIDTYPE_PID); | 1128 | p = pid_task(pid, PIDTYPE_PID); |
1131 | error = -ESRCH; | 1129 | error = -ESRCH; |
1132 | if (p) | 1130 | if (p) |
1133 | error = group_send_sig_info(sig, info, p); | 1131 | error = group_send_sig_info(sig, info, p); |
1134 | if (unlikely(acquired_tasklist_lock)) | 1132 | |
1133 | if (unlikely(sig_needs_tasklist(sig))) | ||
1135 | read_unlock(&tasklist_lock); | 1134 | read_unlock(&tasklist_lock); |
1136 | rcu_read_unlock(); | 1135 | rcu_read_unlock(); |
1137 | return error; | 1136 | return error; |