Free the USB transfers in the reverse order of which they were submitted. This
will avoid that while transfer 0 is cancelledd transfer 1 is started by the
host controller, and so on.
Reported-by: Peter Stuge <redacted>
Signed-off-by: Lars-Peter Clausen <redacted>
static void abort_acquisition(struct context *ctx)
{
- unsigned int i;
+ int i;
ctx->num_samples = -1;
- for (i = 0; i < ctx->num_transfers; i++) {
+ for (i = ctx->num_transfers - 1; i >= 0; i--) {
if (ctx->transfers[i])
libusb_cancel_transfer(ctx->transfers[i]);
}