aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/Incomplete/Sideshow/Sideshow.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/Incomplete/Sideshow/Sideshow.c')
-rw-r--r--Demos/Device/Incomplete/Sideshow/Sideshow.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c
index 3e9778e29..2972e0cf7 100644
--- a/Demos/Device/Incomplete/Sideshow/Sideshow.c
+++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c
@@ -122,13 +122,11 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE))
{
void* DescriptorPointer;
- uint16_t DescriptorSize;
+ uint16_t DescriptorSize = USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
+ &DescriptorPointer, &DescriptorSize);
- if (!(USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
- &DescriptorPointer, &DescriptorSize)))
- {
- return;
- }
+ if (DescriptorSize == NO_DESCRIPTOR)
+ return;
Endpoint_ClearSETUP();