Browse Source

Bugfix: modminer: Ensure devices that fail probe are closed properly

Luke Dashjr 12 years ago
parent
commit
ac77cebfba
1 changed files with 3 additions and 0 deletions
  1. 3 0
      driver-modminer.c

+ 3 - 0
driver-modminer.c

@@ -124,7 +124,10 @@ modminer_detect_one(const char *devpath)
 	applog(LOG_DEBUG, "ModMiner identified as: %s", devname);
 	applog(LOG_DEBUG, "ModMiner identified as: %s", devname);
 
 
 	if (serial_claim_v(devpath, &modminer_drv))
 	if (serial_claim_v(devpath, &modminer_drv))
+	{
+		serial_close(fd);
 		return false;
 		return false;
+	}
 	
 	
 	if (1 != write(fd, MODMINER_FPGA_COUNT, 1))
 	if (1 != write(fd, MODMINER_FPGA_COUNT, 1))
 		bailout(LOG_DEBUG, "ModMiner detect: write failed on %s (get FPGA count)", devpath);
 		bailout(LOG_DEBUG, "ModMiner detect: write failed on %s (get FPGA count)", devpath);