]> git.kernelconcepts.de Git - karo-tx-linux.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)
commitb91939f528fa80e95a7e9592425dd1026d159b2a
treebfd3d2ec2a5cc8af1a9d8591d042685d6105543f
parentf327b340e35b210c936cd109544e672aa7a0e49d
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