Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
e421fe97 f26c2889

+3 -1
+3 -1
drivers/usb/serial/ir-usb.c
··· 307 307 void *dest, size_t size) 308 308 { 309 309 unsigned char *buf = dest; 310 + int count; 310 311 311 312 /* 312 313 * The first byte of the packet we send to the device contains an ··· 318 317 */ 319 318 *buf = ir_xbof | ir_baud; 320 319 321 - return kfifo_out_locked(&port->write_fifo, buf + 1, size - 1, 320 + count = kfifo_out_locked(&port->write_fifo, buf + 1, size - 1, 322 321 &port->lock); 322 + return count + 1; 323 323 } 324 324 325 325 static void ir_process_read_urb(struct urb *urb)