diff options
author | Alon Ziv <alon+git@nolaviz.org> | 2010-10-10 08:32:18 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-22 10:47:37 -0800 |
commit | b7562261f479efd9b821885fdbed4646d11459f9 (patch) | |
tree | 31dd544f15a58f25869bac84ebe5841508f37eaa | |
parent | 12a9dbf4448476b2fb523a64f3a6a4624d5a7da4 (diff) | |
download | lwn-b7562261f479efd9b821885fdbed4646d11459f9.tar.gz lwn-b7562261f479efd9b821885fdbed4646d11459f9.zip |
USB: opticon: Fix long-standing bugs in opticon driver
commit 97cd8dc4ca9a1a5efb2cc38758e01492e3b013e2 upstream.
The bulk-read callback had two bugs:
a) The bulk-in packet's leading two zeros were returned (and the two last
bytes truncated)
b) The wrong URB was transmitted for the second (and later) read requests,
causing further reads to return the entire packet (including leading
zeros)
Signed-off-by: Alon Ziv <alon-git@nolaviz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/opticon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 80f59b6350cb..db7cf0866046 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -99,8 +99,8 @@ static void opticon_bulk_callback(struct urb *urb) available_room = tty_buffer_request_room(tty, data_length); if (available_room) { - tty_insert_flip_string(tty, data, - available_room); + tty_insert_flip_string(tty, data + 2, + data_length); tty_flip_buffer_push(tty); } tty_kref_put(tty); @@ -134,7 +134,7 @@ exit: priv->bulk_address), priv->bulk_in_buffer, priv->buffer_size, opticon_bulk_callback, priv); - result = usb_submit_urb(port->read_urb, GFP_ATOMIC); + result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC); if (result) dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", |