mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
safer
This commit is contained in:
parent
976873ba49
commit
8f53b7c86c
@ -8119,7 +8119,7 @@ static void restart_mining_threads(unsigned int new_n_threads)
|
|||||||
if (!mining_thr)
|
if (!mining_thr)
|
||||||
quit(1, "Failed to calloc mining_thr");
|
quit(1, "Failed to calloc mining_thr");
|
||||||
for (i = 0; i < mining_threads; i++) {
|
for (i = 0; i < mining_threads; i++) {
|
||||||
mining_thr[i] = (struct thr_info *)calloc(1, sizeof(*thr));
|
mining_thr[i] = (struct thr_info *)calloc(1, sizeof(struct thr_info));
|
||||||
if (!mining_thr[i])
|
if (!mining_thr[i])
|
||||||
quit(1, "Failed to calloc mining_thr[%d]", i);
|
quit(1, "Failed to calloc mining_thr[%d]", i);
|
||||||
}
|
}
|
||||||
@ -8143,7 +8143,7 @@ static void restart_mining_threads(unsigned int new_n_threads)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
cgpu->thr = (struct thr_info **)malloc(sizeof(*cgpu->thr) * (cgpu->threads+1));
|
cgpu->thr = (struct thr_info **)malloc(sizeof(struct thr_info *) * (cgpu->threads+1));
|
||||||
cgpu->thr[cgpu->threads] = NULL;
|
cgpu->thr[cgpu->threads] = NULL;
|
||||||
cgpu->status = LIFE_INIT;
|
cgpu->status = LIFE_INIT;
|
||||||
|
|
||||||
@ -8159,8 +8159,10 @@ static void restart_mining_threads(unsigned int new_n_threads)
|
|||||||
cgtime(&thr->last);
|
cgtime(&thr->last);
|
||||||
cgpu->thr[j] = thr;
|
cgpu->thr[j] = thr;
|
||||||
|
|
||||||
if (!cgpu->drv->thread_prepare(thr))
|
if (!cgpu->drv->thread_prepare(thr)) {
|
||||||
|
applog(LOG_ERR, "thread_prepare failed for thread %d", thr->id);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rd_unlock(&devices_lock);
|
rd_unlock(&devices_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user