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: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Oliver Neukum 2009-10-01 14:54:46 +02:00 committed by Greg Kroah-Hartman
parent 63a9609513
commit 4c9fde9b86
1 changed files with 2 additions and 1 deletions

View File

@ -513,7 +513,8 @@ static void visor_read_bulk_callback(struct urb *urb)
tty_kref_put(tty);
}
spin_lock(&priv->lock);
priv->bytes_in += available_room;
if (tty)
priv->bytes_in += available_room;
} else {
spin_lock(&priv->lock);