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:
dongjiuzhu1 2024-01-10 12:14:32 +08:00 committed by Xiang Xiao
parent 0f269b1c2a
commit 7feb547c6f
1 changed files with 10 additions and 0 deletions

View File

@ -644,6 +644,16 @@ static ssize_t usbdev_fs_read(FAR struct file *filep, FAR char *buffer,
PANIC(); 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); nxmutex_unlock(&fs_ep->lock);