Skip to content

Commit 75bcbf2

Browse files
committed
USB: ssu100: fix overrun-error reporting
Fix reporting of overrun errors, which should only be reported once using the inserted null character. Fixes: 6b8f1ca ("USB: ssu100: set tty_flags in ssu100_process_packet") Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent 855515a commit 75bcbf2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/usb/serial/ssu100.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,9 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
490490
if (*tty_flag == TTY_NORMAL)
491491
*tty_flag = TTY_FRAME;
492492
}
493-
if (lsr & UART_LSR_OE){
493+
if (lsr & UART_LSR_OE) {
494494
port->icount.overrun++;
495-
if (*tty_flag == TTY_NORMAL)
496-
*tty_flag = TTY_OVERRUN;
495+
tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
497496
}
498497
}
499498

@@ -511,12 +510,8 @@ static void ssu100_process_read_urb(struct urb *urb)
511510
if ((len >= 4) &&
512511
(packet[0] == 0x1b) && (packet[1] == 0x1b) &&
513512
((packet[2] == 0x00) || (packet[2] == 0x01))) {
514-
if (packet[2] == 0x00) {
513+
if (packet[2] == 0x00)
515514
ssu100_update_lsr(port, packet[3], &flag);
516-
if (flag == TTY_OVERRUN)
517-
tty_insert_flip_char(&port->port, 0,
518-
TTY_OVERRUN);
519-
}
520515
if (packet[2] == 0x01)
521516
ssu100_update_msr(port, packet[3]);
522517

0 commit comments

Comments
 (0)