summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Ziv <alon+git@nolaviz.org>2010-10-10 08:32:18 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 10:22:09 -0700
commit97cd8dc4ca9a1a5efb2cc38758e01492e3b013e2 (patch)
treee7ef87664f93d7af5e4acd78eadf8f50eebd2ce4
parentc19db4c9e49a049054594272d408e101aaf41b27 (diff)
downloadlinux-97cd8dc4ca9a1a5efb2cc38758e01492e3b013e2.tar.gz
linux-97cd8dc4ca9a1a5efb2cc38758e01492e3b013e2.tar.bz2
linux-97cd8dc4ca9a1a5efb2cc38758e01492e3b013e2.zip
USB: opticon: Fix long-standing bugs in opticon driver
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> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/serial/opticon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index ed01f3b2de8c..9ff19c8a122e 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -96,8 +96,8 @@ static void opticon_bulk_callback(struct urb *urb)
/* real data, send it to the tty layer */
tty = tty_port_tty_get(&port->port);
if (tty) {
- tty_insert_flip_string(tty, data,
- data_length);
+ tty_insert_flip_string(tty, data + 2,
+ data_length);
tty_flip_buffer_push(tty);
tty_kref_put(tty);
}
@@ -130,7 +130,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",