drivers/usbdev: stop read when container length is less than the maximum length.
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
0f269b1c2a
commit
7feb547c6f
|
@ -644,6 +644,16 @@ static ssize_t usbdev_fs_read(FAR struct file *filep, FAR char *buffer,
|
|||
|
||||
PANIC();
|
||||
}
|
||||
|
||||
/* The container buffer length is less than the maximum length.
|
||||
* It is an independent packet of requests and needs to be
|
||||
* returned directly.
|
||||
*/
|
||||
|
||||
if (reqlen < fs_ep->ep->maxpacket)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nxmutex_unlock(&fs_ep->lock);
|
||||
|
|
Loading…
Reference in New Issue