From: Bill Pemberton Date: Thu, 5 Aug 2010 21:01:06 +0000 (-0400) Subject: USB: ssu100: refine process_packet in ssu100 X-Git-Tag: firefly_0821_release~9833^2~668^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9b2cef31f2823558eb92a35624d37439599f3f9f;p=firefly-linux-kernel-4.4.55.git USB: ssu100: refine process_packet in ssu100 The status information does not appear at the start of each incoming packet so the check for len < 4 at the start of ssu100_process_packet is wrong. Remove it. Signed-off-by: Bill Pemberton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 2826f013752d..c7193880a2b6 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -575,12 +575,8 @@ static int ssu100_process_packet(struct tty_struct *tty, dbg("%s - port %d", __func__, port->number); - if (len < 4) { - dbg("%s - malformed packet", __func__); - return 0; - } - - if ((packet[0] == 0x1b) && (packet[1] == 0x1b) && + if ((len >= 4) && + (packet[0] == 0x1b) && (packet[1] == 0x1b) && ((packet[2] == 0x00) || (packet[2] == 0x01))) { if (packet[2] == 0x00) priv->shadowLSR = packet[3] & (SERIAL_LSR_OE |