Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107062894
D48298.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
950 B
Referenced Files
None
Subscribers
None
D48298.diff
View Options
diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c
--- a/lib/libusb/libusb10_hotplug.c
+++ b/lib/libusb/libusb10_hotplug.c
@@ -112,22 +112,25 @@
libusb_device *temp;
libusb_device *adev;
libusb_device *bdev;
- unsigned do_loop = 1;
- while (do_loop) {
+ for (;;) {
usleep(4000000);
HOTPLUG_LOCK(ctx);
+ if (ctx->hotplug_handler == NO_THREAD) {
+ while ((adev = TAILQ_FIRST(&ctx->hotplug_devs)) != NULL) {
+ TAILQ_REMOVE(&ctx->hotplug_devs, adev, hotplug_entry);
+ libusb_unref_device(adev);
+ }
+ HOTPLUG_UNLOCK(ctx);
+ break;
+ }
TAILQ_INIT(&hotplug_devs);
- if (ctx->hotplug_handler != NO_THREAD) {
- if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) {
- HOTPLUG_UNLOCK(ctx);
- continue;
- }
- } else {
- do_loop = 0;
+ if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) {
+ HOTPLUG_UNLOCK(ctx);
+ continue;
}
/* figure out which devices are gone */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 12:48 PM (2 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15673441
Default Alt Text
D48298.diff (950 B)
Attached To
Mode
D48298: libusb: fix hotplug sigbus
Attached
Detach File
Event Timeline
Log In to Comment