Commit afad54b4c60d1b98f5d58831f2317602c820b602

Con Kolivas 2013-12-22T22:40:33

Check for removed bxf devices before trying to update work or send messages.

diff --git a/driver-bitfury.c b/driver-bitfury.c
index 8d18694..016539c 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -146,6 +146,9 @@ static bool bxf_send_msg(struct cgpu_info *bitfury, char *buf, enum usb_cmds cmd
 {
 	int err, amount, len;
 
+	if (unlikely(bitfury->usbinfo.nodev))
+		return false;
+
 	len = strlen(buf);
 	applog(LOG_DEBUG, "%s %d: Sending %s", bitfury->drv->name, bitfury->device_id, buf);
 	err = usb_write(bitfury, buf, len, &amount, cmd);
@@ -811,6 +814,9 @@ static void bxf_update_work(struct cgpu_info *bitfury, struct bitfury_info *info
 	struct thr_info *thr = info->thr;
 	struct work *work;
 
+	if (unlikely(bitfury->usbinfo.nodev))
+		return;
+
 	work = get_queue_work(thr, bitfury, thr->id);
 	if (work->drv_rolllimit != info->maxroll) {
 		info->maxroll = work->drv_rolllimit;