diff options
-rw-r--r-- | libusb/core.c | 8 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libusb/core.c b/libusb/core.c index bdf4bb7..5a00dd6 100644 --- a/libusb/core.c +++ b/libusb/core.c @@ -567,6 +567,10 @@ void usbi_disconnect_device(struct libusb_device *dev) dev->attached = 0; usbi_mutex_unlock(&dev->lock); + usbi_mutex_lock(&ctx->usb_devs_lock); + list_del(&dev->list); + usbi_mutex_unlock(&ctx->usb_devs_lock); + /* Signal that an event has occurred for this device if we support hotplug AND * the hotplug pipe is ready. This prevents an event from getting raised during * initial enumeration. libusb_handle_events will take care of dereferencing the @@ -577,10 +581,6 @@ void usbi_disconnect_device(struct libusb_device *dev) usbi_err(DEVICE_CTX(dev), "error writing hotplug message"); } } - - usbi_mutex_lock(&ctx->usb_devs_lock); - list_del(&dev->list); - usbi_mutex_unlock(&ctx->usb_devs_lock); } /* Perform some final sanity checks on a newly discovered device. If this diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 25194c6..acce2c9 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10812 +#define LIBUSB_NANO 10813 |