Don't return an error in usb read if we've managed to get the whole read length we've asked for.
diff --git a/usbutils.c b/usbutils.c
index 96896f4..3286cf8 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2677,11 +2677,14 @@ int _usb_read(struct cgpu_info *cgpu, int intinfo, int epinfo, char *buf, size_t
cgpu->drv->name, cgpu->device_id, err, libusb_error_name(err));
}
}
+ ptr += got;
+ bufleft -= got;
+ if (bufleft < 1)
+ err = LIBUSB_SUCCESS;
+
if (err || readonce)
break;
- ptr += got;
- bufleft -= got;
first = false;