tty: Simplify tty->count math in tty_reopen()
authorDmitry Safonov <dima@arista.com>
Thu, 1 Nov 2018 00:24:49 +0000 (00:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2019 20:40:28 +0000 (21:40 +0100)
commita42c97862837efa6f7d972bb1a81873c8cd5cc71
treed04e6575cc2f18e05a9a02b1401ce4ec87fbbf71
parente6a4caa0b4dd966dc63d15390423cac1cc004c20
tty: Simplify tty->count math in tty_reopen()

commit cf62a1a13749db0d32b5cdd800ea91a4087319de upstream.

As notted by Jiri, tty_ldisc_reinit() shouldn't rely on tty counter.
Simplify math by increasing the counter after reinit success.

Cc: Jiri Slaby <jslaby@suse.com>
Link: lkml.kernel.org/r/<20180829022353.23568-2-dima@arista.com>
Suggested-by: Jiri Slaby <jslaby@suse.com>
Reviewed-by: Jiri Slaby <jslaby@suse.cz>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c