From 7b5884caa58b4611e9a9efcec59270fb9e22409e Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 25 Oct 2013 08:43:55 +1100 Subject: [PATCH] Add cancellable transfers correctly to the ct_list --- usbutils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usbutils.c b/usbutils.c index 58114137..5f41fd05 100644 --- a/usbutils.c +++ b/usbutils.c @@ -96,6 +96,8 @@ /* Keep a global counter of how many async transfers are in place to avoid * shutting down the usb polling thread while they exist. */ int cgusb_transfers; + +/* Linked list of all cancellable transfers. */ static struct list_head ct_list; #ifdef USE_BFLSC @@ -2327,7 +2329,7 @@ static int usb_submit_transfer(struct usb_transfer *ut, struct libusb_transfer * if (cancellable) { ut->cancellable = true; INIT_LIST_HEAD(&ut->list); - list_add(&ct_list, &ut->list); + list_add(&ut->list, &ct_list); } else ut->cancellable = false; cg_wunlock(&cgusb_fd_lock);