summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/serial/generic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 8f78d7b..2a3196a 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -519,10 +519,13 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb)
port->write_urb_busy = 0;
spin_unlock_irqrestore(&port->lock, flags);
- if (status)
+ if (status) {
+ spin_lock_irqsave(&port->lock, flags);
kfifo_reset_out(&port->write_fifo);
- else
+ spin_unlock_irqrestore(&port->lock, flags);
+ } else {
usb_serial_generic_write_start(port);
+ }
}
if (status)
OpenPOWER on IntegriCloud