Commit 0aede509c5f87cfed1a25fcb2fe5382e587f55e2

Con Kolivas 2013-11-30T12:32:34

Revert "Disable USB stats which were not meant to be enabled by default and add extra memory for a memory error when stats are enabled." This reverts commit 693d3916448ddc66f3a109c5e065e99aa8fa9669.

diff --git a/usbutils.c b/usbutils.c
index 991ea75..c893688 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -584,7 +584,7 @@ struct resource_reply *res_reply_head = NULL;
 #define MODE_BULK_WRITE (1 << 3)
 
 // Set this to 0 to remove stats processing
-#define DO_USB_STATS 0
+#define DO_USB_STATS 1
 
 static bool stats_initialised = false;
 
@@ -2171,7 +2171,7 @@ static void newstats(struct cgpu_info *cgpu)
 
 	usb_stats[next_stat].name = cgpu->drv->name;
 	usb_stats[next_stat].device_id = -1;
-	usb_stats[next_stat].details = calloc(1, sizeof(struct cg_usb_stats_details) * C_MAX * 2 + 8);
+	usb_stats[next_stat].details = calloc(1, sizeof(struct cg_usb_stats_details) * C_MAX * 2);
 	if (unlikely(!usb_stats[next_stat].details))
 		quit(1, "USB failed to calloc details for %d", next_stat+1);