1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 12:34:27 +00:00

core: check if GPU thread is disabled before checking if it's waiting on getwork.

Otherwise the watchdog thread segfaults on checking an uninitialised
thr->getwork value.
This commit is contained in:
Noel Maersk 2014-03-17 21:49:46 +02:00
parent e0736b1d5b
commit 106dbee1f9

View File

@ -7160,8 +7160,8 @@ static void *watchdog_thread(void __maybe_unused *userdata)
} }
#endif #endif
/* Thread is waiting on getwork or disabled */ /* Thread is disabled or waiting on getwork */
if (thr->getwork || *denable == DEV_DISABLED) if (*denable == DEV_DISABLED || thr->getwork)
continue; continue;
if (cgpu->status != LIFE_WELL && (now.tv_sec - thr->last.tv_sec < WATCHDOG_SICK_TIME)) { if (cgpu->status != LIFE_WELL && (now.tv_sec - thr->last.tv_sec < WATCHDOG_SICK_TIME)) {