diff options
-rw-r--r-- | daemon/usb-linux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon/usb-linux.c b/daemon/usb-linux.c index c9d4629..334d967 100644 --- a/daemon/usb-linux.c +++ b/daemon/usb-linux.c @@ -352,15 +352,17 @@ int usb_discover(void) usbmuxd_log(LL_WARNING, "Endpoint type mismatch for interface %d of device %d-%d", intf->bInterfaceNumber, bus, address); } } - libusb_free_config_descriptor(config); if(j == config->bNumInterfaces) { usbmuxd_log(LL_WARNING, "Could not find a suitable USB interface for device %d-%d", bus, address); + libusb_free_config_descriptor(config); libusb_close(handle); free(usbdev); continue; } + libusb_free_config_descriptor(config); + if((res = libusb_claim_interface(handle, usbdev->interface)) != 0) { usbmuxd_log(LL_WARNING, "Could not claim interface %d for device %d-%d: %d", usbdev->interface, bus, address, res); libusb_close(handle); |