Commit 0de6ab8b authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Greg Kroah-Hartman

USB: ftdi_sio: Keep going when write errors are encountered.

The use of urb->actual_length to update tx_outstanding_bytes
implicitly assumes that the number of bytes actually written is the
same as the number of bytes we tried to write.  On error that
assumption is violated so just use transfer_buffer_length the number
of bytes we intended to write to the device.

If an error occurs we need to fall through and call
usb_serial_port_softint to wake up processes waiting in
tty_wait_until_sent.
Signed-off-by: default avatarEric W. Biederman <ebiederm@aristanetworks.com>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cea83241
...@@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb) ...@@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb)
return; return;
} }
/* account for transferred data */ /* account for transferred data */
countback = urb->actual_length; countback = urb->transfer_buffer_length;
data_offset = priv->write_offset; data_offset = priv->write_offset;
if (data_offset > 0) { if (data_offset > 0) {
/* Subtract the control bytes */ /* Subtract the control bytes */
...@@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb) ...@@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb)
if (status) { if (status) {
dbg("nonzero write bulk status received: %d", status); dbg("nonzero write bulk status received: %d", status);
return;
} }
usb_serial_port_softint(port); usb_serial_port_softint(port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment