From 8a433f2d7af63438dc2ea9fa8d787177caf71e0e Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Thu, 12 May 2016 00:18:02 +0200 Subject: usb-device: Do not reattach kernel driver if USB interface is not used --- src/usb-device.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/usb-device.c') diff --git a/src/usb-device.c b/src/usb-device.c index 670eb9e..a7fdf6b 100644 --- a/src/usb-device.c +++ b/src/usb-device.c @@ -78,6 +78,9 @@ static void usb_flash_device_info_print(const struct usb_flash_device * dev) { static void usb_reattach_kernel_driver(libusb_device_handle * udev, int interface) { + if ( interface < 0 ) + return; + PRINTF_LINE("Reattach kernel driver to USB interface..."); PRINTF_END(); libusb_release_interface(udev, interface); -- cgit v1.2.3