Re: [PATCH 1/4] tty: Drop tty->count on tty_reopen() failure

2018-08-31 Thread Dmitry Safonov
On Fri, 2018-08-31 at 08:47 +0200, Jiri Slaby wrote: > On 08/29/2018, 06:13 PM, Dmitry Safonov wrote: > > > I would just do: > > > if (!retval) > > > tty->count++; > > > here. Nobody from ldiscs should rely on tty->count. > > > > I thought about that and probably should have described in com

Re: [PATCH 1/4] tty: Drop tty->count on tty_reopen() failure

2018-08-30 Thread Jiri Slaby
On 08/29/2018, 06:13 PM, Dmitry Safonov wrote: >> I would just do: >> if (!retval) >> tty->count++; >> here. Nobody from ldiscs should rely on tty->count. > > I thought about that and probably should have described in commit > message why I haven't done that: I prefer to keep it as was as I

Re: [PATCH 1/4] tty: Drop tty->count on tty_reopen() failure

2018-08-29 Thread Dmitry Safonov
On Wed, 2018-08-29 at 16:38 +0200, Jiri Slaby wrote: > On 08/29/2018, 04:23 AM, Dmitry Safonov wrote: > > In case of tty_ldisc_reinit() failure, tty->count should be > > decremented > > back, otherwise we will never release_tty(). > > Never seen it in the real life, but it seems not really hard to

Re: [PATCH 1/4] tty: Drop tty->count on tty_reopen() failure

2018-08-29 Thread Jiri Slaby
On 08/29/2018, 04:23 AM, Dmitry Safonov wrote: > In case of tty_ldisc_reinit() failure, tty->count should be decremented > back, otherwise we will never release_tty(). > Never seen it in the real life, but it seems not really hard to hit. I did see it. And this fixes it. > Cc: Greg Kroah-Hartman