Merge branch 'master' into hashfast
diff --git a/usbutils.c b/usbutils.c
index f865a36..03fac7d 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2272,6 +2272,7 @@ static int callback_wait(struct usb_transfer *ut, int *transferred, unsigned int
libusb_cancel_transfer(transfer);
/* Now wait for the callback function to be invoked. */
+ mutex_lock(&ut->mutex);
pthread_cond_wait(&ut->cond, &ut->mutex);
}
ret = transfer->status;