From 0e5c716cfcb0c0ae2d26145b7cd711ca6816749e Mon Sep 17 00:00:00 2001 From: Denis Ahrens Date: Mon, 26 Nov 2012 02:41:07 +0100 Subject: [PATCH] ztex: Correctly release mutex and reset FPGA if configuration fails --- driver-ztex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/driver-ztex.c b/driver-ztex.c index 5f7cdb39..4151069d 100644 --- a/driver-ztex.c +++ b/driver-ztex.c @@ -362,8 +362,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->freqM = ztex->freqMaxM+1;; //ztex_updateFreq(ztex);