diff options
-rw-r--r-- | drivers/usb/serial/visor.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 1aa5d20a5d99..8e2d6dd9add0 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -513,7 +513,8 @@ static void visor_read_bulk_callback(struct urb *urb) | |||
513 | tty_kref_put(tty); | 513 | tty_kref_put(tty); |
514 | } | 514 | } |
515 | spin_lock(&priv->lock); | 515 | spin_lock(&priv->lock); |
516 | priv->bytes_in += available_room; | 516 | if (tty) |
517 | priv->bytes_in += available_room; | ||
517 | 518 | ||
518 | } else { | 519 | } else { |
519 | spin_lock(&priv->lock); | 520 | spin_lock(&priv->lock); |