Linux: Don't free() URBs prematurely on hardware error; fix #54
authorPeter Stuge <peter@stuge.se>
Sat, 16 Oct 2010 09:47:14 +0000 (11:47 +0200)
committerPeter Stuge <peter@stuge.se>
Sat, 16 Oct 2010 12:00:21 +0000 (14:00 +0200)
commit9cd9059bf9baac69a9d6c909f4c1e000592fa260
treed20b9baf5cd53955a6fefb3fadd4276e17e98b30
parent116d34f608b02f4e14668450b158acf5db726f95
Linux: Don't free() URBs prematurely on hardware error; fix #54

When an URB in a multi-URB transfer had an error, handle_bulk_completion()
would free all URBs and segfault once the next one completed, instead of
cancelling the remaining URBs and cleaning up as usual.

This is basically the patch from the ticket, plus some restructuring
for increased readability of the function.

Many thanks to Brian Shirley and National Instruments for finding and
fixing this!
libusb/os/linux_usbfs.c