HomeFreeBSD

libusb: fix hotplug sigbus

Description

libusb: fix hotplug sigbus

When a hotplug callback has been registered, and the program using
libusb is calling libusb_exit then the thread handler is set to
NO_THREAD which result in the variable controlling the loop the be set
to 0, it does a last pass through device available without having done
a scan, which result in a sigbus after it tried to unregister all the
devices.

directly break the loop instead and cleanup the list of devices

this fixes the tests with LGPLed libusb's hotplugtest program

MFC After: 3 days
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D48298

Details

Provenance
baptAuthored on Fri, Jan 3, 9:50 AM
Reviewer
kevans
Differential Revision
D48298: libusb: fix hotplug sigbus
Parents
rGd633a7d12105: timeout(1): Add -v/--verbose option to show diagnosis info
Branches
Unknown
Tags
Unknown