Commit 5f041e1a72629bf92eaf81ab077d473a34d9877c

Con Kolivas 2013-04-06T12:51:59

Don't get any work if our queue is already full in avalon_fill.

diff --git a/driver-avalon.c b/driver-avalon.c
index d0087b7..afeb56f 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -785,13 +785,14 @@ static inline void adjust_fan(struct avalon_info *info)
 
 static bool avalon_fill(struct cgpu_info *avalon)
 {
-	struct work *work = get_queued(avalon);
+	struct work *work;
 	int mc = avalon_infos[avalon->device_id]->miner_count;
 
-	if (unlikely(!work))
-		return false;
 	if (avalon->queued >= mc)
 		return true;
+	work = get_queued(avalon);
+	if (unlikely(!work))
+		return false;
 	avalon->works[avalon->work_array * mc + avalon->queued++] = work;
 	if (avalon->queued >= mc)
 		return true;