On Tue, Feb 02, 2021 at 10:01:32PM +0000, Mikolaj Kucharski wrote:

> Hi Marcus,
> 
> Below diff makes umb(4) work for me. All good now.

Cool, thanks for testing Mikolaj.

So OK if I commit this fix Edd, Stuart?


Index: dev/usb/usbdi.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdi.c,v
retrieving revision 1.109
diff -u -p -u -p -r1.109 usbdi.c
--- dev/usb/usbdi.c     1 Feb 2021 09:21:51 -0000       1.109
+++ dev/usb/usbdi.c     2 Feb 2021 06:07:41 -0000
@@ -642,6 +642,10 @@ usbd_device2interface_handle(struct usbd
 
        if (dev->cdesc == NULL)
                return (USBD_NOT_CONFIGURED);
+       if (ifaceno < dev->cdesc->bNumInterfaces) {
+               *iface = &dev->ifaces[ifaceno];
+               return (USBD_NORMAL_COMPLETION);
+       }
        /*
         * The correct interface should be at dev->ifaces[ifaceno], but we've
         * seen non-compliant devices in the wild which present non-contiguous

Reply via email to