Char: riscom8, fix tty refcnt
Subsystems (4)
PATCH 1/2 Char: riscom8, fix tty refcnt
Stanse found a tty refcnt leak on one fail path in rc_transmit. Fix that by jumping to the 'out' label.
Signed-off-by Jiri Slaby <[email protected]>
--- drivers/char/riscom8.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/riscom8.c +1 -1
@@ -467,7 +467,7 @@ static void rc_transmit(struct riscom_board const *bp)rc_out (bp,CD180_CCR ,CCR_CORCHG2 ); port->break_length =0 ; } -return ; + goto out; } count =CD180_NFIFO ;
Signature · 1 line
1.6.4.2
PATCH 2/2 USB: serial/mct_u232, fix tty refcnt
Stanse found a tty refcnt leak in read_int_callback. In fact it's handled wrong altogether. tty_port_tty_get can return NULL and it's not checked in that manner.
Fix that by checking the tty_port_tty_get retval and put tty kref properly.
Signed-off-by Jiri Slaby <[email protected]>
--- drivers/usb/serial/mct_u232.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
drivers/usb/serial/mct_u232.c +6 -3
@@ -566,10 +566,13 @@ static void mct_u232_read_int_callback(struct urb *urb)* Work-a-round: handle the 'usual' bulk-in pipe here */ if (urb->transfer_buffer_length >2 ) { - tty =tty_port_tty_get (&port->port);if (urb->actual_length) { -tty_insert_flip_string (tty, data, urb->actual_length); -tty_flip_buffer_push (tty); + tty =tty_port_tty_get (&port->port); +if (tty) { +tty_insert_flip_string (tty, data, + urb->actual_length); +tty_flip_buffer_push (tty); + }tty_kref_put (tty); } goto exit;
Signature · 1 line
1.6.4.2