From d5935652ed766aea22edcba80c058bf8894195db Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 7 Jan 2022 19:14:48 +0100 Subject: [PATCH] icE1usb: Don't consider altsetting with no endpoints as "ON" find_altsetting_on() must not only find an altsetting with no zero-sized endpoints, but must also make sure there actually are endpoints. This enables compatibility with icE1usb firmware >= 0.1-43-g9674436 --- drivers/dahdi/icE1usb/icE1usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dahdi/icE1usb/icE1usb.c b/drivers/dahdi/icE1usb/icE1usb.c index 024d1de..7f12431 100644 --- a/drivers/dahdi/icE1usb/icE1usb.c +++ b/drivers/dahdi/icE1usb/icE1usb.c @@ -862,7 +862,7 @@ static const struct usb_host_interface *find_altsetting_on(struct usb_interface for (i = 0; i < intf->num_altsetting; i++) { const struct usb_host_interface *alt = &intf->altsetting[i]; - if (!has_ep_packetsize_zero(alt)) + if (!has_ep_packetsize_zero(alt) && alt->desc.bNumEndpoints >= 3) return alt; } return NULL;