USB: gadget: mtp: Fix OUT endpoint request length usage in read
USB: gadget: mtp: Fix OUT endpoint request length usage in read

DWC3 UDC requires OUT endpoint request length to be multiple of
endpoint max packet size.  Hence the OUT endpoint request is
always set to the request buffer size in mtp read.  The buffer
can be allocated dynamically and is always multiple of 1024.
If the count passed to read system call is less than the buffer
size, we end up reading more bytes and not giving it to userspace.

Userspace calls read with 512 bytes for receiving request from the
host.  If the request is for receiving a file, the read is called
with 16K bytes for reading the header and some data.  The remaining
data is received via ioctl.  If 1MB is used as request length for
16K read, the received file will be corrupted.

CRs-Fixed: 499167
Change-Id: I2eedf829f267150ff7a303824e95963219a1f555
Signed-off-by: Pavankumar Kondeti <e4a0348e45a0df0ba79f6b06c66df8ae7aca44a4@codeaurora.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas