Commit 6ccf2fe7ee090e71e21447bf16eb07ce336bc4e9

Con Kolivas 2014-01-09T12:49:33

Age work in nf1_scan to avoid risk of losing a work item and leaking memory.

diff --git a/driver-bitfury.c b/driver-bitfury.c
index 91eb7e9..83b15bd 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -922,6 +922,7 @@ static int64_t nf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
 			struct bitfury_info *info)
 {
 	int64_t ret = 0;
+	int aged;
 
 	if (!info->work) {
 		info->work = get_queue_work(thr, bitfury, thr->id);
@@ -944,12 +945,16 @@ static int64_t nf1_scan(struct thr_info *thr, struct cgpu_info *bitfury,
 			if (owork)
 				submit_nonce(thr, owork, bswap_32(res[j]));
 		}
-		if (owork)
-			work_completed(bitfury, owork);
 		info->owork = info->work;
 		info->work = NULL;
 		ret += 0xffffffffull * i;
 	}
+
+	aged = age_queued_work(bitfury, 6.0);
+	if (aged) {
+		applog(LOG_DEBUG, "%s %d: Aged %d work items", bitfury->drv->name,
+		       bitfury->device_id, aged);
+	}
 	return ret;
 }