USB: serial: add special case for processing of empty read urbs
authorJohan Hovold <jhovold@gmail.com>
Sat, 15 May 2010 15:53:44 +0000 (17:53 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 May 2010 20:21:48 +0000 (13:21 -0700)
Return immediately from generic process_read_urb if urb is empty.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/generic.c

index fcd30b8..a817ced 100644 (file)
@@ -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;