Skip to content

Commit

Permalink
Linux typos 2
Browse files Browse the repository at this point in the history
  • Loading branch information
k1-801 committed Apr 8, 2024
1 parent f3139d9 commit 4e31184
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libusb/hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,6 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_register_callback(unsigned short ven

int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_callback_handle callback_handle)
{
struct hid_hotplug_callback *hotplug_cb = NULL;

if (!libusb_has_capability(LIBUSB_CAP_HAS_HOTPLUG) || !hid_hotplug_context.mutex_state || callback_handle <= 0) {
return -1;
}
Expand All @@ -1357,6 +1355,8 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_call
return -1;
}

int result = -1;

/* Remove this notification */
for (struct hid_hotplug_callback **current = &hid_hotplug_context.hotplug_cbs; *current != NULL; current = &(*current)->next) {
if ((*current)->handle == callback_handle) {
Expand All @@ -1377,7 +1377,7 @@ int HID_API_EXPORT HID_API_CALL hid_hotplug_deregister_callback(hid_hotplug_call

pthread_mutex_unlock(&hid_hotplug_context.mutex);

return 0;
return result;
}

hid_device * hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number)
Expand Down

0 comments on commit 4e31184

Please sign in to comment.