Instead of passing NULL for the context to hotplug callbacks, if the
context happens to be the default context, always pass the explicit
context pointer.
---
 libusb/hotplug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libusb/hotplug.c b/libusb/hotplug.c
index 6b04342..36a8f05 100644
--- a/libusb/hotplug.c
+++ b/libusb/hotplug.c
@@ -167,8 +167,7 @@ static int usbi_hotplug_match_cb (struct libusb_context 
*ctx,
                return 0;
        }
 
-       return hotplug_cb->cb (ctx == usbi_default_context ? NULL : ctx,
-                              dev, event, hotplug_cb->user_data);
+       return hotplug_cb->cb (ctx, dev, event, hotplug_cb->user_data);
 }
 
 void usbi_hotplug_match(struct libusb_context *ctx, struct libusb_device *dev,
-- 
1.8.3.2


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to