Browse Source

Bugfix: SSM: When n2pad<0, release lock before returning

Luke Dashjr 11 years ago
parent
commit
d1cf6227d0
1 changed files with 3 additions and 0 deletions
  1. 3 0
      driver-stratum.c

+ 3 - 0
driver-stratum.c

@@ -112,7 +112,10 @@ bool stratumsrv_update_notify_str(struct pool * const pool, bool clean)
 	struct stratumsrv_job *ssj;
 	struct stratumsrv_job *ssj;
 	ssize_t n2pad = n2size - _ssm_client_octets - _ssm_client_xnonce2sz;
 	ssize_t n2pad = n2size - _ssm_client_octets - _ssm_client_xnonce2sz;
 	if (n2pad < 0)
 	if (n2pad < 0)
+	{
+		cg_runlock(&pool->data_lock);
 		return false;
 		return false;
+	}
 	size_t coinb1in_lenx = swork->nonce2_offset * 2;
 	size_t coinb1in_lenx = swork->nonce2_offset * 2;
 	size_t n2padx = n2pad * 2;
 	size_t n2padx = n2pad * 2;
 	size_t coinb1_lenx = coinb1in_lenx + n2padx;
 	size_t coinb1_lenx = coinb1in_lenx + n2padx;