hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7LEZX
--------------------------------
This reverts commit e2944873415691e5cd9e0b9e246a43249da53fce.
Prepare to backport patch from mainline.
Signed-off-by: Yi Yang yiyang13@huawei.com --- drivers/tty/tty_jobctrl.c | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c index 56c791c81b4f..aa6d0537b379 100644 --- a/drivers/tty/tty_jobctrl.c +++ b/drivers/tty/tty_jobctrl.c @@ -308,18 +308,6 @@ void disassociate_ctty(int on_exit) spin_unlock_irqrestore(&tty->ctrl_lock, flags); tty_unlock(tty); tty_kref_put(tty); - - /* - * Race with tty_signal_session_leader(), current->signal - * ->tty_old_pgrp may be reassigned, put_pid() again to ensure - * the pid does not leak memory. - */ - if (on_exit) { - spin_lock_irq(¤t->sighand->siglock); - put_pid(current->signal->tty_old_pgrp); - current->signal->tty_old_pgrp = NULL; - spin_unlock_irq(¤t->sighand->siglock); - } }
/* Now clear signal->tty under the lock */