Endpoint 0 is stalled if an invalid descriptor type is specified in a standard USB get descriptor request to the HID interface.

This commit is contained in:
rlam23 2023-06-23 07:35:52 -07:00 committed by GitHub
parent 9d229ff28e
commit e47c4f2c41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -500,7 +500,15 @@ static uint8_t USBD_CUSTOM_HID_Setup(USBD_HandleTypeDef *pdev,
} }
} }
USBD_CtlSendData(pdev, pbuf, len); if (pbuf)
{
USBD_CtlSendData(pdev, pbuf, len);
}
else
{
USBD_CtlError(pdev, req);
ret = USBD_FAIL;
}
break; break;
case USB_REQ_GET_INTERFACE : case USB_REQ_GET_INTERFACE :