From: liuji Date: Mon, 12 Dec 2011 01:42:45 +0000 (+0800) Subject: Mtp: fix mtp sync operation no response,hold in error stat. X-Git-Tag: firefly_0821_release~9712^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bb2322bfa9ba5a1f5ecbd0ba4e098894b79acdd4;p=firefly-linux-kernel-4.4.55.git Mtp: fix mtp sync operation no response,hold in error stat. fix bug: while read buffer length > MTP_BULK_BUFFER_SIZE, return -1 errno=EINVAL(22) --- diff --git a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c index d1c259e3eb2d..fce4346bb546 100644 --- a/drivers/usb/gadget/f_mtp.c +++ b/drivers/usb/gadget/f_mtp.c @@ -470,7 +470,7 @@ static ssize_t mtp_read(struct file *fp, char __user *buf, DBG(cdev, "mtp_read(%d)\n", count); if (count > MTP_BULK_BUFFER_SIZE) - return -EINVAL; + count = MTP_BULK_BUFFER_SIZE; /* we will block until we're online */ DBG(cdev, "mtp_read: waiting for online state\n");