Browse Source

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

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

+ 3 - 0
driver-bitforce.c

@@ -195,7 +195,10 @@ static bool bitforce_detect_one(const char *devpath)
 	}
 
 	if (serial_claim_v(devpath, &bitforce_drv))
+	{
+		BFclose(fdDev);
 		return false;
+	}
 	
 	applog(LOG_DEBUG, "Found BitForce device on %s", devpath);
 	initdata = malloc(sizeof(*initdata));