Browse Source

ztex: Correctly release mutex and reset FPGA if configuration fails

Denis Ahrens 13 years ago
parent
commit
1401d61ee1
1 changed files with 4 additions and 1 deletions
  1. 4 1
      driver-ztex.c

+ 4 - 1
driver-ztex.c

@@ -365,8 +365,11 @@ static bool ztex_prepare(struct thr_info *thr)
 	get_datestamp(cgpu->init, &now);
 	
 	ztex_selectFpga(ztex);
-	if (libztex_configureFpga(ztex) != 0)
+	if (libztex_configureFpga(ztex) != 0) {
+		libztex_resetFpga(ztex);
+		ztex_releaseFpga(ztex);
 		return false;
+	}
 	ztex_releaseFpga(ztex);
 	ztex->dclk.freqM = ztex->dclk.freqMaxM+1;;
 	//ztex_updateFreq(thr);