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

Commit e807a62b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "tty: Fix use-after-free of echo_delayed_work member from tty_struct"

parents d55696ba 386c92dd
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -846,8 +846,13 @@ int tty_ldisc_init(struct tty_struct *tty)
 */
void tty_ldisc_deinit(struct tty_struct *tty)
{
	if (tty->ldisc)
	if (tty->ldisc) {
#if defined(CONFIG_TTY_FLUSH_LOCAL_ECHO)
		if (tty->echo_delayed_work.work.func)
			cancel_delayed_work_sync(&tty->echo_delayed_work);
#endif
		tty_ldisc_put(tty->ldisc);
	}
	tty->ldisc = NULL;
}