aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/generic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 88a2c7dce335..9eb4a65ee4d9 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -208,14 +208,15 @@ int usb_serial_generic_write(struct usb_serial_port *port, const unsigned char *
208 208
209 /* only do something if we have a bulk out endpoint */ 209 /* only do something if we have a bulk out endpoint */
210 if (serial->num_bulk_out) { 210 if (serial->num_bulk_out) {
211 spin_lock_bh(&port->lock); 211 unsigned long flags;
212 spin_lock_irqsave(&port->lock, flags);
212 if (port->write_urb_busy) { 213 if (port->write_urb_busy) {
213 spin_unlock_bh(&port->lock); 214 spin_unlock_irqrestore(&port->lock, flags);
214 dbg("%s - already writing", __FUNCTION__); 215 dbg("%s - already writing", __FUNCTION__);
215 return 0; 216 return 0;
216 } 217 }
217 port->write_urb_busy = 1; 218 port->write_urb_busy = 1;
218 spin_unlock_bh(&port->lock); 219 spin_unlock_irqrestore(&port->lock, flags);
219 220
220 count = (count > port->bulk_out_size) ? port->bulk_out_size : count; 221 count = (count > port->bulk_out_size) ? port->bulk_out_size : count;
221 222