sr: fx2lafw: Free transfers in reverse order
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 <peter@stuge.se> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
1a895c6185
commit
e7d087bf0e
|
@ -662,11 +662,11 @@ static int receive_data(int fd, int revents, void *cb_data)
|
|||
|
||||
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]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue