kernel-hacking-2024-linux-s.../drivers/tty
Jiri Slaby 3383427a7b TTY: n_tty, remove bogus checks
* BUG_ON(!tty) in n_tty_set_termios -- it cannot be called with tty ==
  NULL. It is called from two call sites. First, from n_tty_open where
  we have a valid tty. Second, as ld->ops->set_termios from
  tty_set_termios. But there we have a valid tty too.
* if (!tty) in n_tty_open -- why would the TTY layer call ldisc's
  open with an invalid TTY? No it indeed does not. All call sites have
  a tty and dereference that.
* BUG_ON(!tty->read_buf) in n_tty_read -- this used to be a valid
  check. The ldisc handling was broken some time ago when I added the
  check to ensure everything is OK. It still can catch the case, but
  no later than we move the buffer to ldisc data. Then there will be
  no read_buf in tty_struct, i.e. nothing to check for.
* if (!tty->read_buf) in n_tty_receive_buf -- this should never
  happen. All callers of ldisc->ops->receive_ops should hold a
  reference to an ldisc and close (which frees read_buf) cannot be
  called until the reference is dropped.
* if (WARN_ON(!tty->read_buf)) in n_tty_read -- the same as in the
  previous case.

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>
2012-10-22 16:50:53 -07:00
..
hvc Feature: 2012-10-12 22:20:28 +09:00
ipwireless Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
serial TTY fixes for 3.7-rc2 2012-10-19 11:28:59 -07:00
vt TTY: vt, fix paste_selection ldisc handling 2012-10-22 16:50:53 -07:00
amiserial.c
bfin_jtag_comm.c
cyclades.c
ehv_bytechan.c
isicom.c
Kconfig
Makefile
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c
n_hdlc.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c TTY: n_tty, remove bogus checks 2012-10-22 16:50:53 -07:00
nozomi.c
pty.c TTY: move devpts kill to pty 2012-10-22 16:50:13 -07:00
rocket.c
rocket.h
rocket_int.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c sparc64: Add global PMU register dumping via sysrq. 2012-10-16 09:34:01 -07:00
tty_audit.c
tty_buffer.c tty: prevent unnecessary work queue lock checking on flip buffer copy 2012-10-22 16:47:51 -07:00
tty_io.c TTY: move devpts kill to pty 2012-10-22 16:50:13 -07:00
tty_ioctl.c
tty_ldisc.c TTY: ldisc, wait for idle ldisc in release 2012-10-22 16:50:53 -07:00
tty_mutex.c
tty_port.c