Re: [PATCH] pty: cancel pty slave port buf's work in tty_release

From: Alan Cox
Date: Wed Dec 13 2017 - 08:23:15 EST


> diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
> index dc60aee..a6ca634 100644
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -1476,6 +1476,8 @@ static void release_tty(struct tty_struct *tty, int idx)
> if (tty->link)
> tty->link->port->itty = NULL;
> tty_buffer_cancel_work(tty->port);
> + if (tty->link)
> + tty_buffer_cancel_work(tty->link->port);
>
> tty_kref_put(tty->link);
> tty_kref_put(tty);

This looks correct to me, but I do worry about deadlock cases we may be
adding.

Alan