tty: usb-serial krefs
Use kref in the USB serial drivers so that we don't free tty structures from under the URB receive handlers as has historically been the case if you were unlucky. This also gives us a framework for general tty drivers to use tty_port objects and refcount. Contains two err->dev_err changes merged together to fix clashes in the -next tree. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -998,11 +998,12 @@ static void oti6858_read_bulk_callback(struct urb *urb)
|
||||
return;
|
||||
}
|
||||
|
||||
tty = port->port.tty;
|
||||
tty = tty_port_tty_get(&port->port);
|
||||
if (tty != NULL && urb->actual_length > 0) {
|
||||
tty_insert_flip_string(tty, data, urb->actual_length);
|
||||
tty_flip_buffer_push(tty);
|
||||
}
|
||||
tty_kref_put(tty);
|
||||
|
||||
/* schedule the interrupt urb if we are still open */
|
||||
if (port->port.count != 0) {
|
||||
|
Reference in New Issue
Block a user