usbutils.c release_cgpu() sets nodev
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/usbutils.c b/usbutils.c
index d942706..30be288 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -1257,10 +1257,8 @@ int _usb_read(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pro
*processed = got;
- if (NODEV(err)) {
- cgpu->nodev = true;
+ if (NODEV(err))
release_cgpu(cgpu);
- }
return err;
}
@@ -1318,10 +1316,8 @@ goteol:
*processed = tot;
- if (NODEV(err)) {
- cgpu->nodev = true;
+ if (NODEV(err))
release_cgpu(cgpu);
- }
return err;
}
@@ -1354,10 +1350,8 @@ int _usb_write(struct cgpu_info *cgpu, int ep, char *buf, size_t bufsiz, int *pr
*processed = sent;
- if (NODEV(err)) {
- cgpu->nodev = true;
+ if (NODEV(err))
release_cgpu(cgpu);
- }
return err;
}
@@ -1384,10 +1378,8 @@ int _usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest
STATS_TIMEVAL(&tv_finish);
USB_STATS(cgpu, &tv_start, &tv_finish, err, cmd, SEQ0);
- if (NODEV(err)) {
- cgpu->nodev = true;
+ if (NODEV(err))
release_cgpu(cgpu);
- }
return err;
}