tty: Fix USB kref leak
The sysrq code acquired a kref leak. Fix it by passing the tty separately from the caller (thus effectively using the callers kref which all the callers hold anyway) Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -1038,7 +1038,7 @@ static void pl2303_read_bulk_callback(struct urb *urb)
|
||||
if (line_status & UART_OVERRUN_ERROR)
|
||||
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
|
||||
for (i = 0; i < urb->actual_length; ++i)
|
||||
if (!usb_serial_handle_sysrq_char(port, data[i]))
|
||||
if (!usb_serial_handle_sysrq_char(tty, port, data[i]))
|
||||
tty_insert_flip_char(tty, data[i], tty_flag);
|
||||
tty_flip_buffer_push(tty);
|
||||
}
|
||||
|
Reference in New Issue
Block a user