mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Look for timeout overruns in usb read/write.
This commit is contained in:
parent
ccb742399f
commit
73f6a570f3
@ -2586,7 +2586,7 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
|
|||||||
if (unlikely(done >= max))
|
if (unlikely(done >= max))
|
||||||
break;
|
break;
|
||||||
timeout = initial_timeout - (done * 1000);
|
timeout = initial_timeout - (done * 1000);
|
||||||
if (!timeout)
|
if (timeout <= 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2674,7 +2674,7 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
|
|||||||
if (unlikely(done >= max))
|
if (unlikely(done >= max))
|
||||||
break;
|
break;
|
||||||
timeout = initial_timeout - (done * 1000);
|
timeout = initial_timeout - (done * 1000);
|
||||||
if (!timeout)
|
if (timeout <= 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2795,7 +2795,7 @@ int _usb_write(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_
|
|||||||
if (unlikely(done >= max))
|
if (unlikely(done >= max))
|
||||||
break;
|
break;
|
||||||
timeout = initial_timeout - (done * 1000);
|
timeout = initial_timeout - (done * 1000);
|
||||||
if (!timeout)
|
if (timeout <= 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user