Commit 6ab7b2b34ac13d01151b0d001c0f5529a6ef4fab

ckolivas 2014-01-29T10:50:22

Check that we've cleared the pipe error after a clear request, not the err value which is unchanged.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/usbutils.c b/usbutils.c
index aba650b..1b64184 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2586,7 +2586,7 @@ pipe_retry:
 			if (pipeerr)
 				cgpu->usbinfo.clear_fail_count++;
 		} while (pipeerr && ++retries < USB_RETRY_MAX);
-		if (!err && ++pipe_retries < USB_RETRY_MAX)
+		if (!pipeerr && ++pipe_retries < USB_RETRY_MAX)
 			goto pipe_retry;
 	}
 	if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)