Skip to content

Commit

Permalink
USB: ssu100: refine process_packet in ssu100
Browse files Browse the repository at this point in the history
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 <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed Aug 24, 2010
1 parent 1752305 commit 9b2cef3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/serial/ssu100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit 9b2cef3

Please sign in to comment.