aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 5630255d2e2a..228fdb5c01d1 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1119,19 +1119,18 @@ kill_pg_info(int sig, struct siginfo *info, pid_t pgrp)
1119int kill_pid_info(int sig, struct siginfo *info, struct pid *pid) 1119int 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;
@@ -2283,7 +2282,7 @@ static int do_tkill(int tgid, int pid, int sig)
2283 * @pid: the PID of the thread 2282 * @pid: the PID of the thread
2284 * @sig: signal to be sent 2283 * @sig: signal to be sent
2285 * 2284 *
2286 * This syscall also checks the tgid and returns -ESRCH even if the PID 2285 * This syscall also checks the @tgid and returns -ESRCH even if the PID
2287 * exists but it's not belonging to the target process anymore. This 2286 * exists but it's not belonging to the target process anymore. This
2288 * method solves the problem of threads exiting and PIDs getting reused. 2287 * method solves the problem of threads exiting and PIDs getting reused.
2289 */ 2288 */