Page MenuHomeFreeBSD

libusb: implement libusb_hotplug_get_user_data
ClosedPublic

Authored by aokblast on Jul 9 2025, 8:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 4, 8:52 PM
Unknown Object (File)
Mon, Aug 4, 2:25 AM
Unknown Object (File)
Mon, Aug 4, 12:50 AM
Unknown Object (File)
Mon, Jul 28, 11:49 AM
Unknown Object (File)
Mon, Jul 28, 9:30 AM
Unknown Object (File)
Mon, Jul 28, 8:31 AM
Unknown Object (File)
Mon, Jul 28, 8:01 AM
Unknown Object (File)
Mon, Jul 28, 6:00 AM

Details

Summary

libusb provides a function to get the callback userdata for a given
callback sincwe this structure is opaque to libusb user.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj added inline comments.
lib/libusb/libusb.3
780
781
lib/libusb/libusb10_hotplug.c
429

Presumably you need to release the lock before returning?

Or, just break; here, and return (handle) below. It is guaranteed that TAILQ_FOREACH will set the iterator variable to NULL after the loop reaches the end of the queue and terminates.

lib/libusb/libusb.3
780

returns?

lib/libusb/libusb.3
780

Yes, sorry.

hi! please address the concerns in the diff (including that lock handling, heh) and then i'll approve! thanks!

lib/libusb/libusb10_hotplug.c
433

Don't you want to return handle here?

Fix false return after drunk too much

This revision is now accepted and ready to land.Tue, Jul 15, 1:55 PM
lwhsu added a subscriber: lwhsu.
lwhsu added inline comments.
lib/libusb/libusb.h
597

don't forget to align the style with other functions.