Page MenuHomeFreeBSD

D23430.id67515.diff
No OneTemporary

D23430.id67515.diff

Index: lib/libusb/libusb10_hotplug.c
===================================================================
--- lib/libusb/libusb10_hotplug.c
+++ lib/libusb/libusb10_hotplug.c
@@ -123,8 +123,10 @@
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;
}
@@ -132,15 +134,19 @@
/* figure out which devices are gone */
TAILQ_FOREACH_SAFE(adev, &ctx->hotplug_devs, hotplug_entry, temp) {
TAILQ_FOREACH(bdev, &hotplug_devs, hotplug_entry) {
- if (libusb_hotplug_equal(adev, bdev))
+ if (libusb_hotplug_equal(adev, bdev)) {
+ HOTPLUG_UNLOCK(ctx);
break;
+ }
}
if (bdev == NULL) {
TAILQ_REMOVE(&ctx->hotplug_devs, adev, hotplug_entry);
TAILQ_FOREACH_SAFE(acbh, &ctx->hotplug_cbh, entry, bcbh) {
if (libusb_hotplug_filter(ctx, acbh, adev,
- LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT) == 0)
+ LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT) == 0) {
+ HOTPLUG_UNLOCK(ctx);
continue;
+ }
TAILQ_REMOVE(&ctx->hotplug_cbh, acbh, entry);
free(acbh);
}
@@ -151,16 +157,20 @@
/* figure out which devices are new */
TAILQ_FOREACH_SAFE(adev, &hotplug_devs, hotplug_entry, temp) {
TAILQ_FOREACH(bdev, &ctx->hotplug_devs, hotplug_entry) {
- if (libusb_hotplug_equal(adev, bdev))
+ if (libusb_hotplug_equal(adev, bdev)) {
+ HOTPLUG_UNLOCK(ctx);
break;
+ }
}
if (bdev == NULL) {
TAILQ_REMOVE(&hotplug_devs, adev, hotplug_entry);
TAILQ_INSERT_TAIL(&ctx->hotplug_devs, adev, hotplug_entry);
TAILQ_FOREACH_SAFE(acbh, &ctx->hotplug_cbh, entry, bcbh) {
if (libusb_hotplug_filter(ctx, acbh, adev,
- LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) == 0)
+ LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) == 0) {
+ HOTPLUG_UNLOCK(ctx);
continue;
+ }
TAILQ_REMOVE(&ctx->hotplug_cbh, acbh, entry);
free(acbh);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 21, 7:02 PM (10 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37047203
Default Alt Text
D23430.id67515.diff (2 KB)

Event Timeline