Commit 4c9fde9b authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: visor: fix trivial accounting bug in visor driver

usb:usbserial:visor: fix accounting in error case

data not pushed to the tty layer due to an error mustn't be counted
Signed-off-by: default avatarOliver Neukum <oliver@neukum.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 63a96095
...@@ -513,7 +513,8 @@ static void visor_read_bulk_callback(struct urb *urb) ...@@ -513,7 +513,8 @@ static void visor_read_bulk_callback(struct urb *urb)
tty_kref_put(tty); tty_kref_put(tty);
} }
spin_lock(&priv->lock); spin_lock(&priv->lock);
priv->bytes_in += available_room; if (tty)
priv->bytes_in += available_room;
} else { } else {
spin_lock(&priv->lock); spin_lock(&priv->lock);
......
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