diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-03-26 21:33:39 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2012-03-26 21:41:40 +0100 |
commit | d041159a1720c14568154c07f94b01340b991417 (patch) | |
tree | e7c15b051836caea565b05f756bd1f08af787ea9 /libusb | |
parent | 76af4c99bd6122c1dd7b58858b669c919d8c8806 (diff) | |
download | libusb-d041159a1720c14568154c07f94b01340b991417.tar.gz |
Linux: Fix cancel_transfer return value when cancelling a multi-urb transfer
* if we've successfully cancelled the last urb, and then another urb
fails with errno == EINVAL, we shouldn't return LIBUSB_ERROR_NOT_FOUND
Diffstat (limited to 'libusb')
-rw-r--r-- | libusb/os/linux_usbfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c index ad3c37a..703d844 100644 --- a/libusb/os/linux_usbfs.c +++ b/libusb/os/linux_usbfs.c @@ -1483,7 +1483,8 @@ static int discard_urbs(struct usbi_transfer *itransfer, int first, int last_plu if (EINVAL == errno) { usbi_dbg("URB not found --> assuming ready to be reaped"); - ret = LIBUSB_ERROR_NOT_FOUND; + if (i == (last_plus_one - 1)) + ret = LIBUSB_ERROR_NOT_FOUND; } else if (ENODEV == errno) { usbi_dbg("Device not found for URB --> assuming ready to be reaped"); ret = LIBUSB_ERROR_NO_DEVICE; |