diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c index 96e3bf9a12ca..fb1c3d59e51f 100644 --- a/lib/libusb/libusb10_hotplug.c +++ b/lib/libusb/libusb10_hotplug.c @@ -123,8 +123,10 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) { + HOTPLUG_UNLOCK(ctx); continue; + } } else { do_loop = 0; }