Mtp: fix mtp sync operation no response,hold in error stat.
authorliuji <liuji@liuji@rock-chips.com>
Mon, 12 Dec 2011 01:42:45 +0000 (09:42 +0800)
committerliuji <liuji@rock-chips.com>
Mon, 12 Dec 2011 08:46:31 +0000 (16:46 +0800)
fix bug: while read buffer length > MTP_BULK_BUFFER_SIZE, return -1
errno=EINVAL(22)

drivers/usb/gadget/f_mtp.c

index d1c259e3eb2dd087bfe752ba75bb8108717f73ee..fce4346bb5462315103002387078669f9746f725 100644 (file)
@@ -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");