]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadgetfs: return number of bytes on ep0 read request
authorThomas Faber <thfabba@gmx.de>
Fri, 2 Mar 2012 08:41:50 +0000 (09:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 17:31:34 +0000 (10:31 -0700)
commit5c9e6ce0ca99917cda4a9a07b5442c793f98cfea
tree713ef091e1467372a97de4d3c36b145e2ec9f665
parent6d59824b8c2ea2b64e6b532628e1a5bdcd3c6487
usb: gadgetfs: return number of bytes on ep0 read request

commit 85b4b3c8c189e0159101f7628a71411af072ff69 upstream.

A read from GadgetFS endpoint 0 during the data stage of a control
request would always return 0 on success (as returned by
wait_event_interruptible) despite having written data into the user
buffer.
This patch makes it correctly set the return value to the number of
bytes read.

Signed-off-by: Thomas Faber <thfabba@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/inode.c