Fix possible infinite loop in the control stream write template functions.
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / HIDClassHost.c
index c3375e6..b43435d 100644 (file)
@@ -99,7 +99,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
        HIDInterfaceInfo->Config.DataINPipe.Type  = EP_TYPE_INTERRUPT;
 
        if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1)))
-         return false;
+         return HID_ENUMERROR_PipeConfigurationFailed;
 
        if (DataOUTEndpoint)
        {
@@ -108,7 +108,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
                HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT;
 
                if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1)))
-                 return false;
+                 return HID_ENUMERROR_PipeConfigurationFailed;
        }
 
        HIDInterfaceInfo->State.InterfaceNumber      = HIDInterface->InterfaceNumber;
@@ -238,7 +238,7 @@ uint8_t HID_Host_SendReportByID(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
 {
 #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
        if ((USB_HostState != HOST_STATE_Configured) || !(HIDInterfaceInfo->State.IsActive))
-         return false;
+         return PIPE_RWSTREAM_NoError;
 
        if (HIDInterfaceInfo->State.DeviceUsesOUTPipe && (ReportType == HID_REPORT_ITEM_Out))
        {