From 7ce0547575e11cb9ce94f86fcce3709d060dcc00 Mon Sep 17 00:00:00 2001 From: heyuanjie87 Date: Thu, 17 Jan 2013 14:03:45 +0800 Subject: [PATCH] fixed the string descriptor send to host more than actual --- components/drivers/usb/usbdevice/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;