Commit 634958ff1cb3264dabe3a7f857c0b79955340eeb

Con Kolivas 2012-12-09T15:44:20

Merge pull request #352 from kanoi/api usbutils.c uninitialised usbstat for non-primary mmqs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/usbutils.c b/usbutils.c
index cc76937..fe8931a 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -1061,6 +1061,9 @@ static void newstats(struct cgpu_info *cgpu)
 void update_usb_stats(__maybe_unused struct cgpu_info *cgpu)
 {
 #if DO_USB_STATS
+	if (cgpu->usbstat < 1)
+		newstats(cgpu);
+
 	// we don't know the device_id until after add_cgpu()
 	usb_stats[cgpu->usbstat - 1].device_id = cgpu->device_id;
 #endif