]> git.baikalelectronics.ru Git - kernel.git/commit
TTY: n_tty, simplify read_buf+echo_buf allocation
authorJiri Slaby <jslaby@suse.cz>
Thu, 18 Oct 2012 20:26:35 +0000 (22:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Oct 2012 23:50:53 +0000 (16:50 -0700)
commit713019ffff855816f3c84052fc4ef633dd8f52fc
treebfd3d2ec2a5cc8af1a9d8591d042685d6105543f
parent594fccd0f3553b5fa349cf9288bc8df418bc98fd
TTY: n_tty, simplify read_buf+echo_buf allocation

ldisc->open and close are called only once and cannot cross. So the
tests in open and close are superfluous. Remove them. (But leave sets
to NULL to ensure there is not a bug somewhere.)

And when the tests are gone, handle properly failures in open. We
leaked read_buf if allocation of echo_buf failed before. Now this is
not the case anymore.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c