Skip to content

Commit

Permalink
Bugfix: modminer: Avoid leaking devname when detecting claimed devices
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Nov 28, 2014
1 parent 549bafc commit 9575a95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions driver-modminer.c
Expand Up @@ -132,15 +132,15 @@ modminer_detect_one(const char *devpath)
buf[len] = '\0';
if (strncasecmp(buf, "ModMiner", 8))
bailout(LOG_DEBUG, "%s: %s: response did not begin with 'ModMiner'", __func__, devpath);
char*devname = strdup(buf);
applog(LOG_DEBUG, "ModMiner identified as: %s", devname);
applog(LOG_DEBUG, "ModMiner identified as: %s", buf);

if (serial_claim_v(devpath, &modminer_drv))
{
serial_close(fd);
return false;
}

char*devname = strdup(buf);
if (1 != write(fd, MODMINER_FPGA_COUNT, 1))
bailout(LOG_DEBUG, "ModMiner detect: write failed on %s (get FPGA count)", devpath);
len = read(fd, buf, 1);
Expand Down

0 comments on commit 9575a95

Please sign in to comment.