]> git.baikalelectronics.ru Git - kernel.git/commit
USB: quatech2: only write to the tty if the port is open.
authorBill Pemberton <wfp5p@virginia.edu>
Wed, 13 Mar 2013 13:50:15 +0000 (09:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2013 19:32:47 +0000 (12:32 -0700)
commit3b11dce8f569e250539e3f3de664a22d86472f91
tree766c1d602d3942be6ba24086c7752926f70197c5
parent2869df2eb6d2ab570b5c85ce190049ce941f8b21
USB: quatech2: only write to the tty if the port is open.

The commit eab53c9d0578df4b9ddfd52a9d142b5f3210adf9 removed the checks
that prevented qt2_process_read_urb() from trying to put chars into
ttys that weren't actually opened.  This resulted in 'tty is NULL'
warnings from flush_to_ldisc() when the device was used.

The devices use just one read urb for all ports.  As a result
qt2_process_read_urb() may be called with the current port set to a
port number that has not been opened.  Add a check if the port is open
before calling tty_flip_buffer_push().

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/quatech2.c