mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-16 05:50:19 +00:00
ia64: ptrace_attach_sync_user_rbs: avoid "task->signal != NULL" checks
Preparation to make task->signal immutable, no functional changes. It doesn't matter which pointer we check under tasklist to ensure the task was not released, ->signal or ->sighand. But we are going to make ->signal refcountable, change the code to use ->sighand. Note: this code doesn't need this check and tasklist_lock at all, it should be converted to use lock_task_sighand(). And, the code under SIGNAL_STOP_STOPPED check looks wrong. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Roland McGrath <roland@redhat.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d30fda3551
commit
ffdf91856c
@ -638,7 +638,7 @@ ptrace_attach_sync_user_rbs (struct task_struct *child)
|
||||
*/
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
if (child->signal) {
|
||||
if (child->sighand) {
|
||||
spin_lock_irq(&child->sighand->siglock);
|
||||
if (child->state == TASK_STOPPED &&
|
||||
!test_and_set_tsk_thread_flag(child, TIF_RESTORE_RSE)) {
|
||||
@ -662,7 +662,7 @@ ptrace_attach_sync_user_rbs (struct task_struct *child)
|
||||
* job control stop, so that SIGCONT can be used to wake it up.
|
||||
*/
|
||||
read_lock(&tasklist_lock);
|
||||
if (child->signal) {
|
||||
if (child->sighand) {
|
||||
spin_lock_irq(&child->sighand->siglock);
|
||||
if (child->state == TASK_TRACED &&
|
||||
(child->signal->flags & SIGNAL_STOP_STOPPED)) {
|
||||
|
Loading…
Reference in New Issue
Block a user