diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-01 21:33:45 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-01 21:33:45 -0500 |
commit | 9d3f1881abeae0494a27716b08fcf2d3264bb0fa (patch) | |
tree | f457dd2d35af29bc831b93865efa47229d0b9bee /drivers/usb/serial/generic.c | |
parent | b6c58b1d987a5795086c5c2babd8c7367d2fdb8c (diff) | |
parent | bc10e875d4aeaa93a0d418d8b4346b72f5067ea0 (diff) |
Merge branch 'sh/stable-updates'
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r-- | drivers/usb/serial/generic.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index f1ea3a33b6e6..83443d6306d6 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -386,12 +386,12 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty) | |||
386 | 386 | ||
387 | dbg("%s - port %d", __func__, port->number); | 387 | dbg("%s - port %d", __func__, port->number); |
388 | 388 | ||
389 | if (serial->type->max_in_flight_urbs) { | 389 | spin_lock_irqsave(&port->lock, flags); |
390 | spin_lock_irqsave(&port->lock, flags); | 390 | if (serial->type->max_in_flight_urbs) |
391 | chars = port->tx_bytes_flight; | 391 | chars = port->tx_bytes_flight; |
392 | spin_unlock_irqrestore(&port->lock, flags); | 392 | else if (serial->num_bulk_out) |
393 | } else if (serial->num_bulk_out) | ||
394 | chars = kfifo_len(&port->write_fifo); | 393 | chars = kfifo_len(&port->write_fifo); |
394 | spin_unlock_irqrestore(&port->lock, flags); | ||
395 | 395 | ||
396 | dbg("%s - returns %d", __func__, chars); | 396 | dbg("%s - returns %d", __func__, chars); |
397 | return chars; | 397 | return chars; |
@@ -489,6 +489,8 @@ void usb_serial_generic_write_bulk_callback(struct urb *urb) | |||
489 | dbg("%s - port %d", __func__, port->number); | 489 | dbg("%s - port %d", __func__, port->number); |
490 | 490 | ||
491 | if (port->serial->type->max_in_flight_urbs) { | 491 | if (port->serial->type->max_in_flight_urbs) { |
492 | kfree(urb->transfer_buffer); | ||
493 | |||
492 | spin_lock_irqsave(&port->lock, flags); | 494 | spin_lock_irqsave(&port->lock, flags); |
493 | --port->urbs_in_flight; | 495 | --port->urbs_in_flight; |
494 | port->tx_bytes_flight -= urb->transfer_buffer_length; | 496 | port->tx_bytes_flight -= urb->transfer_buffer_length; |