From: Johan Hovold Date: Sat, 15 May 2010 15:53:44 +0000 (+0200) Subject: USB: serial: add special case for processing of empty read urbs X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=56a1df46c19150db0a9b0f0c14e0b1d42e7f32d4;p=linux-beck.git USB: serial: add special case for processing of empty read urbs Return immediately from generic process_read_urb if urb is empty. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index fcd30b841559..a817ced82835 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -324,6 +324,9 @@ void usb_serial_generic_process_read_urb(struct urb *urb) char *ch = (char *)urb->transfer_buffer; int i; + if (!urb->actual_length) + return; + tty = tty_port_tty_get(&port->port); if (!tty) return;