From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbdLMNXM (ORCPT ); Wed, 13 Dec 2017 08:23:12 -0500 Received: from www.llwyncelyn.cymru ([82.70.14.225]:60948 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbdLMNXJ (ORCPT ); Wed, 13 Dec 2017 08:23:09 -0500 Date: Wed, 13 Dec 2017 13:22:55 +0000 From: Alan Cox To: kpark3469@gmail.com Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, jslaby@suse.com, keun-o.park@darkmatter.ae Subject: Re: [PATCH] pty: cancel pty slave port buf's work in tty_release Message-ID: <20171213132255.6a2013be@alans-desktop> In-Reply-To: <1513141848-15124-1-git-send-email-kpark3469@gmail.com> References: <1513141848-15124-1-git-send-email-kpark3469@gmail.com> Organization: Intel Corporation X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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