]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
USB: serial: keyspan_pda: fix dropped unthrottle interrupts
authorJohan Hovold <johan@kernel.org>
Sun, 25 Oct 2020 17:45:47 +0000 (18:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:26:10 +0000 (11:26 +0100)
commit 696c541c8c6cfa05d65aa24ae2b9e720fc01766e upstream.

Commit c528fcb116e6 ("USB: serial: keyspan_pda: fix receive sanity
checks") broke write-unthrottle handling by dropping well-formed
unthrottle-interrupt packets which are precisely two bytes long. This
could lead to blocked writers not being woken up when buffer space again
becomes available.

Instead, stop unconditionally printing the third byte which is
(presumably) only valid on modem-line changes.

Fixes: c528fcb116e6 ("USB: serial: keyspan_pda: fix receive sanity checks")
Cc: stable <stable@vger.kernel.org> # 4.11
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/keyspan_pda.c

index 38d43c4b7ce547700e007f6f406d17f2c65d3ca4..3ac74d3d758edcf55e45d80a15b47f78e8907d56 100644 (file)
@@ -172,11 +172,11 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
                break;
        case 1:
                /* status interrupt */
-               if (len < 3) {
+               if (len < 2) {
                        dev_warn(&port->dev, "short interrupt message received\n");
                        break;
                }
-               dev_dbg(&port->dev, "rx int, d1=%d, d2=%d\n", data[1], data[2]);
+               dev_dbg(&port->dev, "rx int, d1=%d\n", data[1]);
                switch (data[1]) {
                case 1: /* modemline change */
                        break;