Skip to content

Commit

Permalink
signal: use kill_proc_info instead of kill_pid_info in kill_something…
Browse files Browse the repository at this point in the history
…_info

signal.c provides kill_proc_info, we can use it instead of kill_pid_info
in kill_something_info func gracefully.

Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/80236965-f0b5-c888-95ff-855bdec75bb3@huawei.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Zhiqiang Liu authored and Christian Brauner committed Apr 12, 2020
1 parent eaec2b0 commit 3075afd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,12 +1557,8 @@ static int kill_something_info(int sig, struct kernel_siginfo *info, pid_t pid)
{
int ret;

if (pid > 0) {
rcu_read_lock();
ret = kill_pid_info(sig, info, find_vpid(pid));
rcu_read_unlock();
return ret;
}
if (pid > 0)
return kill_proc_info(sig, info, pid);

/* -INT_MIN is undefined. Exclude this case to avoid a UBSAN warning */
if (pid == INT_MIN)
Expand Down

0 comments on commit 3075afd

Please sign in to comment.