diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-05-19 00:01:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 13:21:50 -0700 |
commit | e421fe97adf96a2b1f9d89140ec3e184f0cb7d7c (patch) | |
tree | a6b476bbbe775c69c290f8a5390b0f634a5b19a9 /drivers/usb/serial/ir-usb.c | |
parent | f26c2889a4d937371e2ec9b5690ac407f0496634 (diff) | |
download | linux-e421fe97adf96a2b1f9d89140ec3e184f0cb7d7c.tar.bz2 |
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>
Diffstat (limited to 'drivers/usb/serial/ir-usb.c')
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index e7087f9fe479..ccbce4066d04 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, void *dest, size_t size) { unsigned char *buf = dest; + int count; /* * 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, */ *buf = ir_xbof | ir_baud; - return kfifo_out_locked(&port->write_fifo, buf + 1, size - 1, + count = kfifo_out_locked(&port->write_fifo, buf + 1, size - 1, &port->lock); + return count + 1; } static void ir_process_read_urb(struct urb *urb) |