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
pull/10747/head
Tomas Rezucha 2023-02-10 15:49:11 +01:00
rodzic 648b1a41c6
commit 31ff3bc0c2
1 zmienionych plików z 0 dodań i 3 usunięć

Wyświetl plik

@ -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;