From: Oliver Neukum Date: Thu, 1 Oct 2009 12:54:46 +0000 (+0200) Subject: USB: visor: fix trivial accounting bug in visor driver X-Git-Tag: v3.0~7202^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c9fde9b860ccb27a7b026844eb3ef64c77e5a49;p=platform%2Fkernel%2Flinux-amlogic.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 1aa5d20..8e2d6dd 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) 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);