Skip to content

Commit 4c9fde9

Browse files
Oliver Neukumgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 63a9609 commit 4c9fde9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/usb/serial/visor.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ static void visor_read_bulk_callback(struct urb *urb)
513513
tty_kref_put(tty);
514514
}
515515
spin_lock(&priv->lock);
516-
priv->bytes_in += available_room;
516+
if (tty)
517+
priv->bytes_in += available_room;
517518

518519
} else {
519520
spin_lock(&priv->lock);

0 commit comments

Comments
 (0)