Browse Source

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 <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Johan Hovold 15 years ago
parent
commit
56a1df46c1
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/usb/serial/generic.c

+ 3 - 0
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;