Commit d2f253cdea191f32ef881b7fd80d4f07f517e1b4

Con Kolivas 2014-02-23T22:42:15

Check for an amount along with no error in hfa clear readbuf

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 5850803..93bab93 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -470,7 +470,7 @@ static bool hfa_clear_readbuf(struct cgpu_info *hashfast)
 			break;
 		}
 		ret = usb_read(hashfast, buf, 512, &amount, C_HF_CLEAR_READ);
-	} while (!ret);
+	} while (!ret && amount);
 
 	if (ret && ret != LIBUSB_ERROR_TIMEOUT)
 		return false;