mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-19 21:03:32 -04:00
737ba04ea40f19564b445fbb489907529e75edc9
A submitted transfer that has just been failed by the kernel could be picked up by an event handler to be cleaned up, where freeing of URB memory would race with the submit function doing it's own cleanup and freeing as a result of the submit failing. libusb_submit_transfer() always holds itransfer->lock, so the race can be avoided by taking that lock also in the cleanup path and checking that the URB memory has not already been freed before freeing it there. As http://libusb.org/ticket/81#comment:14 notes there is still another possible, but unlikely, race condition between libusb_submit_transfer() and an event handling thread. That will require more work to solve. [stuge: Add check in cleanup path that URBs have not already been freed]
libusb ====== libusb is a library for USB device access from Linux, Mac OS X and Windows userspace. It is written in C and licensed under the LGPL-2.1 (see COPYING). libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. See the PORTING file for some information, if you fancy a challenge :) libusb homepage: http://libusb.org/ Developers will wish to consult the API documentation: http://libusb.sourceforge.net/api-1.0/ Use the mailing list for questions, comments, etc: https://sourceforge.net/mailarchive/forum.php?forum_name=libusb-devel - Daniel Drake <dsd@gentoo.org> - Peter Stuge <peter@stuge.se> (use the mailing list rather than mailing developers directly)
Description
Languages
C
91.7%
C++
3.1%
CMake
1.6%
Batchfile
1.1%
Makefile
1%
Other
1.5%