aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2010-05-18 18:01:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:50 -0400
commite421fe97adf96a2b1f9d89140ec3e184f0cb7d7c (patch)
treea6b476bbbe775c69c290f8a5390b0f634a5b19a9
parentf26c2889a4d937371e2ec9b5690ac407f0496634 (diff)
USB: ir-usb: fix incorrect write-buffer length
Returned length should include header length. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/serial/ir-usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index e7087f9fe47..ccbce4066d0 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -307,6 +307,7 @@ static int ir_prepare_write_buffer(struct usb_serial_port *port,
307 void *dest, size_t size) 307 void *dest, size_t size)
308{ 308{
309 unsigned char *buf = dest; 309 unsigned char *buf = dest;
310 int count;
310 311
311 /* 312 /*
312 * The first byte of the packet we send to the device contains an 313 * The first byte of the packet we send to the device contains an
@@ -317,8 +318,9 @@ static int ir_prepare_write_buffer(struct usb_serial_port *port,
317 */ 318 */
318 *buf = ir_xbof | ir_baud; 319 *buf = ir_xbof | ir_baud;
319 320
320 return kfifo_out_locked(&port->write_fifo, buf + 1, size - 1, 321 count = kfifo_out_locked(&port->write_fifo, buf + 1, size - 1,
321 &port->lock); 322 &port->lock);
323 return count + 1;
322} 324}
323 325
324static void ir_process_read_urb(struct urb *urb) 326static void ir_process_read_urb(struct urb *urb)