> list_for_each_entry() uses next as it steps through the list.
> list_for_each_entry_safe() avoids the problem by getting and saving the
> next pointer in a temporary before the loop body.

Ah right. I misread what you wrote and thought there was another issue 
at hand there. Your patch looks good to me too.

I looked to see if we needed to apply a similar fix elsewhere but it 
looks like only thread_windows.c used a list_del() in list_for_each_entry().

I have now pushed the NULLing of prev/next on deletion along with the 
thread_windows fix to the repo.


Sebastian,

can you try recompiling and installing libusbx from the latest git 
version? Be mindful that after picking up the repo using it, you will 
need to run autogen.sh to get configure and makefile created for you. 
While this latest change will not fix the issue, the expectation is that 
it will help make it manifest itself sooner and give us more explicit 
hints as to where the cause lies.

If you do observe the crash again, and since you're recompiling the 
library, I would also advise you to try changing line 1307 in 
libusb/io.c from:

        if (r) {

to
        if (r && (r != LIBUSB_ERROR_BUSY)) {

As explained previously, I'm seeing a small chance that your crash is 
caused by a double deletion in the list if the same transfer is 
submitted twice, and this change could help fix it.

Regards,

/Pete


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to