Commit 54f8554af46c6ea7e554f5e32a633347f3c0c64b

Paul Sheppard 2012-07-04T18:46:41

Ad fd check to clear buffer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/driver-bitforce.c b/driver-bitforce.c
index 27494c4..07ca917 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -143,6 +143,9 @@ static void biforce_clear_buffer(struct cgpu_info *bitforce)
 	int fdDev = bitforce->device_fd;
 	char pdevbuf[0x100];
 
+	if (!fdDev)
+		return;
+
 	applog(LOG_DEBUG, "BFL%i: Clearing read buffer", bitforce->device_id);
 
 	mutex_lock(&bitforce->device_mutex);