• reillyg's avatar
    Avoid a race between libusb_submit_transfer and libusb_free_transfer. · ce48c8a3
    reillyg authored
    The tail end of libusb_submit_transfer assumes that the transfer object
    is still valid. It may in fact have already been freed by the transfer
    completion callback if that call occurs on a different thread. As a
    simply workaround (since the libusb code will be going away soon) this
    patch simply posts the transfer deletion back to the thread where
    libusb_submit_transfer is called so that they are serialized.
    
    BUG=487712
    
    Review URL: https://codereview.chromium.org/1126203008
    
    Cr-Commit-Position: refs/heads/master@{#329953}
    ce48c8a3
usb_device_handle_impl.cc 33.2 KB