Commit c92fe1cfadf967c20526b6bdb9f6b482e24473f1

ckolivas 2014-03-12T08:33:55

Check device data exists on a hfa instance before trying to reinit it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/driver-hashfast.c b/driver-hashfast.c
index 45f53c0..efbf754 100644
--- a/driver-hashfast.c
+++ b/driver-hashfast.c
@@ -1880,7 +1880,8 @@ static void hfa_statline_before(char *buf, size_t bufsiz, struct cgpu_info *hash
  * again. */
 static void hfa_reinit(struct cgpu_info *hashfast)
 {
-	hfa_running_shutdown(hashfast, hashfast->device_data);
+	if (hashfast && hashfast->device_data)
+		hfa_running_shutdown(hashfast, hashfast->device_data);
 }
 
 static void hfa_free_all_work(struct hashfast_info *info)