Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 356fc355 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "tty: fix memleak in alloc_pid"

parents a1fdd9e1 5c70c756
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -874,9 +874,8 @@ void disassociate_ctty(int on_exit)
	spin_lock_irq(&current->sighand->siglock);
	put_pid(current->signal->tty_old_pgrp);
	current->signal->tty_old_pgrp = NULL;
	spin_unlock_irq(&current->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(&current->sighand->siglock);
	/* Now clear signal->tty under the lock */
	read_lock(&tasklist_lock);
	session_clear_tty(task_session(current));