Browse Source

Merge branch 'bugfix_deref_after_free' into bfgminer

Conflicts:
	miner.c
Luke Dashjr 13 years ago
parent
commit
f4ef47603e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      miner.c

+ 3 - 2
miner.c

@@ -4216,6 +4216,7 @@ static bool work_rollable(struct work *work)
 static bool hash_push(struct work *work)
 static bool hash_push(struct work *work)
 {
 {
 	bool rc = true, dec = false;
 	bool rc = true, dec = false;
+	struct pool *pool = work->pool;
 
 
 	if (work->queued) {
 	if (work->queued) {
 		work->queued = false;
 		work->queued = false;
@@ -4223,7 +4224,7 @@ static bool hash_push(struct work *work)
 	}
 	}
 
 
 	mutex_lock(stgd_lock);
 	mutex_lock(stgd_lock);
-	work->pool->staged++;
+	pool->staged++;
 	if (work_rollable(work))
 	if (work_rollable(work))
 		staged_rollable++;
 		staged_rollable++;
 	if (likely(!getq->frozen)) {
 	if (likely(!getq->frozen)) {
@@ -4235,7 +4236,7 @@ static bool hash_push(struct work *work)
 	mutex_unlock(stgd_lock);
 	mutex_unlock(stgd_lock);
 
 
 	if (dec) {
 	if (dec) {
-		dec_queued(work->pool);
+		dec_queued(pool);
 		applog(LOG_DEBUG, "dec_queued from hash_push");
 		applog(LOG_DEBUG, "dec_queued from hash_push");
 	}
 	}