If the backend init fails, the control goes to err_io_exit which tries
to clean up hotplug related lists that aren't initialized. Moving
hotplug_init before makes sure the lists are valid so if backend init
fails they get cleaned up without errors.
Closes #989
list_add(&_ctx->list, &active_contexts_list);
usbi_mutex_static_unlock(&active_contexts_lock);
+ usbi_hotplug_init(_ctx);
+
if (usbi_backend.init) {
r = usbi_backend.init(_ctx);
if (r)
goto err_io_exit;
}
- usbi_hotplug_init(_ctx);
if (ctx)
*ctx = _ctx;
-#define LIBUSB_NANO 11653
+#define LIBUSB_NANO 11654