Fix to previous patch (make CDCHost demo deallocate pipes when an invalid CDC interfa...
[pub/USBasp.git] / Demos / Host / MouseHost / ConfigDescriptor.c
index f29eda1..435a4f9 100644 (file)
@@ -69,7 +69,8 @@ uint8_t ProcessConfigurationDescriptor(void)
          return InvalidConfigDataReturned;\r
        \r
        /* Get the mouse interface from the configuration descriptor */\r
          return InvalidConfigDataReturned;\r
        \r
        /* Get the mouse interface from the configuration descriptor */\r
-       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextMouseInterface))\r
+       if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
+                                     NextMouseInterface) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
@@ -77,7 +78,7 @@ uint8_t ProcessConfigurationDescriptor(void)
 \r
        /* Get the mouse interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
 \r
        /* Get the mouse interface's data endpoint descriptor */\r
        if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
-                                     NextInterfaceMouseDataEndpoint))\r
+                                     NextInterfaceMouseDataEndpoint) != DESCRIPTOR_SEARCH_COMP_Found)\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r
        {\r
                /* Descriptor not found, error out */\r
                return NoEndpointFound;\r