]> git.baikalelectronics.ru Git - kernel.git/commit
TTY: pty, fix tty buffers leak
authorJiri Slaby <jslaby@suse.cz>
Thu, 15 Nov 2012 08:49:49 +0000 (09:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Nov 2012 01:18:55 +0000 (17:18 -0800)
commit40fb89f63e42a77de029dc63a430fd0b7a125afa
tree2ca7959df8ebba974bc9ba9011ab25e0550ed63d
parent4641d6dc9ec2bdc861ffa4444ba70b30d092895f
TTY: pty, fix tty buffers leak

After commit "TTY: move tty buffers to tty_port", the tty buffers are
not freed in some drivers. This is because tty_port_destructor is not
called whenever a tty_port is freed. This was an assumption I counted
with but was unfortunately untrue. So fix the drivers to fulfil this
assumption.

PTY is one of those, here we just need to use tty_port_put instead of
kfree. (Assuming tty_port_destructor does not need port->ops to be set
which we change here too.)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/pty.c
drivers/tty/tty_port.c