Browse Source

Bugfix: titan: Fix segfault

Vitalii Demianets 11 years ago
parent
commit
57fa5cd48b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      driver-titan.c

+ 4 - 3
driver-titan.c

@@ -438,11 +438,12 @@ static void knc_titan_poll(struct thr_info * const thr)
 		if (!work_accepted)
 			break;
 		if (knc->need_flush) {
+			struct work *work1, *tmp1;
 			knc->need_flush = false;
 			applog(LOG_NOTICE, "%s: Flushing stale works", knc_titan_drv.dname);
-			HASH_ITER(hh, knc->devicework, work, tmp) {
-				HASH_DEL(knc->devicework, work);
-				free_work(work);
+			HASH_ITER(hh, knc->devicework, work1, tmp1) {
+				HASH_DEL(knc->devicework, work1);
+				free_work(work1);
 			}
 			delay_usecs = 0;
 		}