Commit f1ab8ea9e7eba981c9d087fed46ff86f9eb938ec

Kano 2013-03-04T21:18:42

Release MMQ device only once (not 4 times)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/usbutils.c b/usbutils.c
index 6b2997e..a4527a8 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -859,6 +859,10 @@ static void release_cgpu(struct cgpu_info *cgpu)
 	struct cgpu_info *lookcgpu;
 	int i;
 
+	// It has already been done
+	if (cgpu->usbinfo.nodev)
+		return;
+
 	cgpu->usbinfo.nodev = true;
 	cgpu->usbinfo.nodev_count++;
 	gettimeofday(&(cgpu->usbinfo.last_nodev), NULL);