summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/drivers/usb/usbdevice/core/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/core/core.c b/components/drivers/usb/usbdevice/core/core.c
index ea4efde2d7..9f1738ed33 100644
--- a/components/drivers/usb/usbdevice/core/core.c
+++ b/components/drivers/usb/usbdevice/core/core.c
@@ -124,7 +124,7 @@ static rt_err_t _get_string_descriptor(struct udevice* device, ureq_t setup)
}
}
- if(setup->length == 0xFF)
+ if(setup->length > len)
len = str_desc.bLength;
else
len = setup->length;