summaryrefslogtreecommitdiffstats
path: root/src/usb-device.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2016-05-12 00:18:02 +0200
committerPali Rohár <pali.rohar@gmail.com>2016-05-12 00:18:02 +0200
commit8a433f2d7af63438dc2ea9fa8d787177caf71e0e (patch)
tree1851a4055c3165652124e7d8d733cd9ec4160427 /src/usb-device.c
parentcf95375177c0ee8d96a87b77d64c999070d6e805 (diff)
download0xFFFF-8a433f2d7af63438dc2ea9fa8d787177caf71e0e.tar.bz2
usb-device: Do not reattach kernel driver if USB interface is not used
Diffstat (limited to 'src/usb-device.c')
-rw-r--r--src/usb-device.c3
1 files changed, 3 insertions, 0 deletions
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);