summaryrefslogtreecommitdiff
path: root/libusb
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2008-04-27 23:30:34 +0100
committerDaniel Drake <dsd@gentoo.org>2008-04-29 12:08:39 +0100
commit2ddf81420557d016bbcbf28dda0d8d1c64d16264 (patch)
tree9f1a7429803ff484650d16653f41531e5745cf28 /libusb
parent7ac0a405b4c57db42e88cbcba5f135697f03b646 (diff)
downloadlibusb-2ddf81420557d016bbcbf28dda0d8d1c64d16264.tar.gz
Fix unlocked flying_transfers list access
Diffstat (limited to 'libusb')
-rw-r--r--libusb/io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libusb/io.c b/libusb/io.c
index 1d3cdd3..9cea4df 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -633,8 +633,11 @@ static int submit_transfer(struct usbi_transfer *itransfer)
add_to_flying_list(itransfer);
r = usbi_backend->submit_transfer(itransfer);
- if (r < 0)
+ if (r < 0) {
+ pthread_mutex_lock(&flying_transfers_lock);
list_del(&itransfer->list);
+ pthread_mutex_unlock(&flying_transfers_lock);
+ }
return r;
}