Merge "tty: fix memleak in alloc_pid"
This commit is contained in:
commit
356fc355a4
|
@ -874,9 +874,8 @@ void disassociate_ctty(int 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);
|
||||
|
||||
tty = get_current_tty();
|
||||
tty = tty_kref_get(current->signal->tty);
|
||||
if (tty) {
|
||||
unsigned long flags;
|
||||
spin_lock_irqsave(&tty->ctrl_lock, flags);
|
||||
|
@ -893,6 +892,7 @@ void disassociate_ctty(int on_exit)
|
|||
#endif
|
||||
}
|
||||
|
||||
spin_unlock_irq(¤t->sighand->siglock);
|
||||
/* Now clear signal->tty under the lock */
|
||||
read_lock(&tasklist_lock);
|
||||
session_clear_tty(task_session(current));
|
||||
|
|
Loading…
Reference in New Issue