Commit 8d18327ee933437c5d43ba9d0c708bfc0b57ae49

Con Kolivas 2014-02-27T22:02:55

Cope with the API calling hfa on partially initialised devices having no info.

diff --git a/driver-hashfast.c b/driver-hashfast.c
index d92c045..7798fd2 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -1665,13 +1665,17 @@ restart:
 
 static struct api_data *hfa_api_stats(struct cgpu_info *cgpu)
 {
-	struct hashfast_info *info = cgpu->device_data;
+	struct hashfast_info *info;
 	struct hf_long_usb_stats1 *s1;
 	struct api_data *root = NULL;
 	struct hf_usb_init_base *db;
 	int varint, i;
 	char buf[64];
 
+	info = cgpu->device_data;
+	if (!info)
+		return NULL;
+
 	root = api_add_int(root, "asic count", &info->asic_count, false);
 	root = api_add_int(root, "core count", &info->core_count, false);