Skip to content

Commit

Permalink
USB: ftdi_sio: Keep going when write errors are encountered.
Browse files Browse the repository at this point in the history
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: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Eric W. Biederman authored and Greg Kroah-Hartman committed Dec 1, 2009
1 parent cea8324 commit 0de6ab8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb)
return;
}
/* account for transferred data */
countback = urb->actual_length;
countback = urb->transfer_buffer_length;
data_offset = priv->write_offset;
if (data_offset > 0) {
/* Subtract the control bytes */
Expand All @@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb)

if (status) {
dbg("nonzero write bulk status received: %d", status);
return;
}

usb_serial_port_softint(port);
Expand Down

0 comments on commit 0de6ab8

Please sign in to comment.