diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c index 9c46d4926bf..359c818b572 100644 --- a/lib/libusb/libusb10_hotplug.c +++ b/lib/libusb/libusb10_hotplug.c @@ -430,5 +430,7 @@ libusb_hotplug_get_user_data(struct libusb_context *ctx, } HOTPLUG_UNLOCK(ctx); - return (handle); + if (handle != NULL) + return (handle->user_data); + return (NULL); }