mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
usb_host: Fix interface descriptor parsing
Previously the USB host driver did not accept interface number greater or equal bNumInterfaces, even though these are valid interface numbers
This commit is contained in:
parent
648b1a41c6
commit
31ff3bc0c2
@ -76,9 +76,6 @@ int usb_parse_interface_number_of_alternate(const usb_config_desc_t *config_desc
|
||||
const usb_intf_desc_t *usb_parse_interface_descriptor(const usb_config_desc_t *config_desc, uint8_t bInterfaceNumber, uint8_t bAlternateSetting, int *offset)
|
||||
{
|
||||
assert(config_desc != NULL);
|
||||
if (bInterfaceNumber >= config_desc->bNumInterfaces) {
|
||||
return NULL; //bInterfaceNumber is out of range
|
||||
}
|
||||
|
||||
//Walk to first interface descriptor of bInterfaceNumber
|
||||
int offset_temp = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user