Browse Source

Free avalon->works in the event we call avalon_prepare on failure to initialise.

nfactor-troky
Con Kolivas 12 years ago
parent
commit
b2106b3aed
  1. 4
      driver-avalon.c

4
driver-avalon.c

@ -645,9 +645,13 @@ static bool avalon_prepare(struct thr_info *thr)
struct avalon_info *info = avalon_infos[avalon->device_id]; struct avalon_info *info = avalon_infos[avalon->device_id];
struct timeval now; struct timeval now;
free(avalon->works);
avalon->works = calloc(info->miner_count * sizeof(struct work *), 4); avalon->works = calloc(info->miner_count * sizeof(struct work *), 4);
if (!avalon->works) if (!avalon->works)
quit(1, "Failed to calloc avalon works in avalon_prepare"); quit(1, "Failed to calloc avalon works in avalon_prepare");
if (avalon->device_fd == -1)
avalon_init(avalon);
else
__avalon_init(avalon); __avalon_init(avalon);
gettimeofday(&now, NULL); gettimeofday(&now, NULL);

Loading…
Cancel
Save