Browse Source

Merge branch 'hashbuster' into bfgminer-3.5.x

Conflicts:
	driver-hashbuster.c
Luke Dashjr 12 years ago
parent
commit
c8c62b690f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      driver-hashbuster.c

+ 6 - 0
driver-hashbuster.c

@@ -182,8 +182,11 @@ bool hashbuster_foundlowl(struct lowlevel_device_info * const info, __maybe_unus
 		       __func__, path);
 	
 	if ((!hashbuster_io(h, buf, buf)) || buf[1] != 0x07)
+	{
+		hid_close(h);
 		applogr(false, LOG_DEBUG, "%s: Identify sequence didn't match on %s",
 		        __func__, path);
+	}
 		
 	const int chip_n = hashbuster_chip_count(h);
 	
@@ -236,7 +239,10 @@ bool hashbuster_init(struct thr_info * const thr)
 	lowlevel_devinfo_free(cgpu->device_data);
 	
 	if (!h)
+	{
+		hid_close(h);
 		applogr(false, LOG_ERR, "%s: Failed to open hid device", cgpu->dev_repr);
+	}
 	
 	port = malloc(sizeof(*port));
 	if (!port)