Commit 304781f1c804a77abd9294dce45120343f9e3f1f

Con Kolivas 2014-07-28T18:08:46

Fix error in 2nd read functions for av2 and hro

diff --git a/driver-avalon2.c b/driver-avalon2.c
index 85f42a3..51a6a39 100644
--- a/driver-avalon2.c
+++ b/driver-avalon2.c
@@ -392,7 +392,7 @@ static inline int avalon2_gets(struct cgpu_info *avalon2, uint8_t *buf)
 				i -= 1;
 				if (i) {
 					err = usb_read(avalon2, (char *)buf, read_amount, &ret, C_AVA2_READ);
-					if (unlikely(err < 0 || ret != i)) {
+					if (unlikely(err < 0 || ret != read_amount)) {
 						if (err != -7)
 							applog(LOG_ERR, "Avalon2: Error %d on 2nd read in avalon_gets got %d", err, ret);
 						return AVA2_GETS_ERROR;
diff --git a/driver-hashratio.c b/driver-hashratio.c
index 3ade713..3f4dc7f 100644
--- a/driver-hashratio.c
+++ b/driver-hashratio.c
@@ -293,7 +293,7 @@ static inline int hashratio_gets(struct cgpu_info *hashratio, uint8_t *buf)
 				i -= 1;
 				if (i) {
 					err = usb_read(hashratio, (char *)buf, read_amount, &ret, C_HRO_READ);
-					if (unlikely(err < 0 || ret != i)) {
+					if (unlikely(err < 0 || ret != read_amount)) {
 						applog(LOG_ERR, "hashratio: Error on 2nd read in hashratio_gets got %d", ret);
 						return HRTO_GETS_ERROR;
 					}