Skip to content

Commit 855515a

Browse files
committed
USB: keyspan: fix overrun-error reporting
Fix reporting of overrun errors, which are not associated with a character. Instead insert a null character and report only once. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent 5d1678a commit 855515a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

drivers/usb/serial/keyspan.c

+11-10
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,13 @@ static void usa26_indat_callback(struct urb *urb)
311311
if ((data[0] & 0x80) == 0) {
312312
/* no errors on individual bytes, only
313313
possible overrun err */
314-
if (data[0] & RXERROR_OVERRUN)
315-
err = TTY_OVERRUN;
316-
else
317-
err = 0;
314+
if (data[0] & RXERROR_OVERRUN) {
315+
tty_insert_flip_char(&port->port, 0,
316+
TTY_OVERRUN);
317+
}
318318
for (i = 1; i < urb->actual_length ; ++i)
319-
tty_insert_flip_char(&port->port, data[i], err);
319+
tty_insert_flip_char(&port->port, data[i],
320+
TTY_NORMAL);
320321
} else {
321322
/* some bytes had errors, every byte has status */
322323
dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
@@ -787,13 +788,13 @@ static void usa90_indat_callback(struct urb *urb)
787788
if ((data[0] & 0x80) == 0) {
788789
/* no errors on individual bytes, only
789790
possible overrun err*/
790-
if (data[0] & RXERROR_OVERRUN)
791-
err = TTY_OVERRUN;
792-
else
793-
err = 0;
791+
if (data[0] & RXERROR_OVERRUN) {
792+
tty_insert_flip_char(&port->port, 0,
793+
TTY_OVERRUN);
794+
}
794795
for (i = 1; i < urb->actual_length ; ++i)
795796
tty_insert_flip_char(&port->port,
796-
data[i], err);
797+
data[i], TTY_NORMAL);
797798
} else {
798799
/* some bytes had errors, every byte has status */
799800
dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);

0 commit comments

Comments
 (0)