bm13xx: Handle invalid job ids in process_work

This commit is contained in:
SatoshyBoy 2023-09-08 18:15:45 -04:00 committed by johnny9
parent 8e63b02b6c
commit ed67d44a54
2 changed files with 6 additions and 0 deletions

View File

@ -672,6 +672,11 @@ task_result * BM1366_proccess_work(void * pvParameters)
GlobalState * GLOBAL_STATE = (GlobalState *) pvParameters;
if (GLOBAL_STATE->valid_jobs[rx_job_id] == 0) {
ESP_LOGE(TAG, "Invalid job nonce found, id=%d", rx_job_id);
return NULL;
}
uint32_t rolled_version = GLOBAL_STATE->ASIC_TASK_MODULE.active_jobs[rx_job_id]->version;
// // // shift the 16 bit value left 13

View File

@ -425,6 +425,7 @@ task_result *BM1397_proccess_work(void *pvParameters)
if (GLOBAL_STATE->valid_jobs[rx_job_id] == 0)
{
ESP_LOGI(TAG, "Invalid job nonce found, id=%d", rx_job_id);
return NULL;
}
uint32_t rolled_version = GLOBAL_STATE->ASIC_TASK_MODULE.active_jobs[rx_job_id]->version;