projects
/
platform
/
upstream
/
libusb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
core: Suppress hotplug events during initial enumeration
[platform/upstream/libusb.git]
/
libusb
/
hotplug.c
diff --git
a/libusb/hotplug.c
b/libusb/hotplug.c
index
402e693
..
6b743c7
100644
(file)
--- a/
libusb/hotplug.c
+++ b/
libusb/hotplug.c
@@
-171,6
+171,9
@@
void usbi_hotplug_exit(struct libusb_context *ctx)
if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG))
return;
+ if (!usbi_atomic_load(&ctx->hotplug_ready))
+ return;
+
/* free all registered hotplug callbacks */
for_each_hotplug_cb_safe(ctx, hotplug_cb, next_cb) {
list_del(&hotplug_cb->list);