Browse Source

Check for nodev on hashfast driver and disable it if it has disappeared.

Con Kolivas 12 years ago
parent
commit
f5679aaa61
1 changed files with 6 additions and 0 deletions
  1. 6 0
      driver-hashfast.c

+ 6 - 0
driver-hashfast.c

@@ -688,6 +688,12 @@ static int64_t hfa_scanwork(struct thr_info *thr)
 	int64_t hashes;
 	int jobs, ret;
 
+	if (unlikely(hashfast->usbinfo.nodev)) {
+		applog(LOG_WARNING, "HFA %d: device disappeared, disabling",
+		       hashfast->device_id);
+		return -1;
+	}
+
 	if (unlikely(thr->work_restart)) {
 restart:
 		ret = hfa_send_frame(hashfast, HF_USB_CMD(OP_WORK_RESTART), 0, (uint8_t *)NULL, 0);