sim/rawgadget: don't push fifo if ioctl failed because it will cause busy read

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2023-07-16 14:15:53 +08:00 committed by Xiang Xiao
parent 14446677d3
commit ddc2c62aa8

View File

@ -629,6 +629,8 @@ static void *host_raw_ephandle(void *arg)
if (io)
{
int len;
if (entry->halted)
{
host_raw_epclearhalt(dev->fd, entry->raw_epid);
@ -638,8 +640,12 @@ static void *host_raw_ephandle(void *arg)
io->inner.ep = entry->raw_epid;
io->inner.flags = 0;
io->inner.length = USB_RAW_EP_MAX_LEN;
io->inner.length = host_raw_epread(dev->fd, &io->inner);
USB_RAW_FIFO_PUSH(&entry->fifo);
len = host_raw_epread(dev->fd, &io->inner);
if (len > 0)
{
io->inner.length = len;
USB_RAW_FIFO_PUSH(&entry->fifo);
}
}
else
{