Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: fix console error reporting

Do not report errors in write path if port is used as a console as this
may trigger the same error (and error report) resulting in a loop.

Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
548dd4b6 e688355b

+3 -1
+3 -1
drivers/usb/serial/generic.c
··· 217 217 clear_bit(i, &port->write_urbs_free); 218 218 result = usb_submit_urb(urb, GFP_ATOMIC); 219 219 if (result) { 220 - dev_err(&port->dev, "%s - error submitting urb: %d\n", 220 + if (!port->port.console) { 221 + dev_err(&port->dev, "%s - error submitting urb: %d\n", 221 222 __func__, result); 223 + } 222 224 set_bit(i, &port->write_urbs_free); 223 225 spin_lock_irqsave(&port->lock, flags); 224 226 port->tx_bytes -= count;