diff options
author | Alexander Pyhalov <apyhalov@gmail.com> | 2018-05-24 15:06:46 +0300 |
---|---|---|
committer | Nathan Hjelm <hjelmn@me.com> | 2019-04-04 22:26:40 -0600 |
commit | fcce301c7fcfc254d8f4e67312fff944b1d15ec8 (patch) | |
tree | 94e7ccd05ed9c824389c84ef4ca055edb4b04818 /libusb/os/sunos_usb.c | |
parent | a9b34d170a5e88a827bc30b23da919b2d796c32d (diff) | |
download | libusb-fcce301c7fcfc254d8f4e67312fff944b1d15ec8.tar.gz |
transfer_lock should be released before usbi_handle_transfer_completion() call
Closes #430
Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Diffstat (limited to 'libusb/os/sunos_usb.c')
-rw-r--r-- | libusb/os/sunos_usb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libusb/os/sunos_usb.c b/libusb/os/sunos_usb.c index 70e1383..ecd4aad 100644 --- a/libusb/os/sunos_usb.c +++ b/libusb/os/sunos_usb.c @@ -1360,9 +1360,15 @@ solaris_submit_ctrl_on_default(struct libusb_transfer *transfer) } usbi_dbg("Done: ctrl data bytes %d", ret); - /* sync transfer handling */ + /** + * Sync transfer handling. + * We should release transfer lock here and later get it back + * as usbi_handle_transfer_completion() takes its own transfer lock. + */ + usbi_mutex_unlock(&LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer)->lock); ret = usbi_handle_transfer_completion(LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer), transfer->status); + usbi_mutex_lock(&LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer)->lock); return (ret); } |