diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2009-11-17 22:10:48 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-11-30 19:43:15 -0500 |
commit | 0de6ab8b91f2e1e8e7fc66a8b5c5e8ca82ea16b7 (patch) | |
tree | 8b7438074e39102a056696d3ea96b9a6a08542c3 | |
parent | cea83241b3a84499c4f9b12f8288f787e7aa6383 (diff) |
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: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 9c60d6d4908a..ebcc6d0e2e91 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1937,7 +1937,7 @@ static void ftdi_write_bulk_callback(struct urb *urb) | |||
1937 | return; | 1937 | return; |
1938 | } | 1938 | } |
1939 | /* account for transferred data */ | 1939 | /* account for transferred data */ |
1940 | countback = urb->actual_length; | 1940 | countback = urb->transfer_buffer_length; |
1941 | data_offset = priv->write_offset; | 1941 | data_offset = priv->write_offset; |
1942 | if (data_offset > 0) { | 1942 | if (data_offset > 0) { |
1943 | /* Subtract the control bytes */ | 1943 | /* Subtract the control bytes */ |
@@ -1950,7 +1950,6 @@ static void ftdi_write_bulk_callback(struct urb *urb) | |||
1950 | 1950 | ||
1951 | if (status) { | 1951 | if (status) { |
1952 | dbg("nonzero write bulk status received: %d", status); | 1952 | dbg("nonzero write bulk status received: %d", status); |
1953 | return; | ||
1954 | } | 1953 | } |
1955 | 1954 | ||
1956 | usb_serial_port_softint(port); | 1955 | usb_serial_port_softint(port); |