]> git.baikalelectronics.ru Git - kernel.git/commit
tty: Fix ldisc leak in failed tty_init_dev()
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 10 Jan 2016 05:13:46 +0000 (21:13 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2016 22:28:20 +0000 (14:28 -0800)
commitfeb0659e5c7682a7b0a2e641cad1b7467f5c1f4f
tree5315047eaf79a1e2db862ab4502569b42b2b9136
parentfa216a0f3474fe5246892913a9dcefba0b5b5969
tty: Fix ldisc leak in failed tty_init_dev()

release_tty() leaks the ldisc instance when called directly (rather
than when releasing the file descriptor from tty_release()).

Since tty_ldisc_release() clears tty->ldisc, releasing the ldisc
instance at tty teardown if tty->ldisc is non-null is not in danger
of double-releasing the ldisc.

Remove deinitialize_tty_struct() now that free_tty_struct() always
performs the tty_ldisc_deinit().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/pty.c
drivers/tty/tty_io.c
drivers/tty/tty_ldisc.c
include/linux/tty.h