host: schedule: check task_init op before calling

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2019-04-04 17:38:18 +02:00 committed by Liam Girdwood
parent d3e68f91e4
commit d0a46c26e7
1 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,10 @@ int schedule_task_init(struct task *task, uint16_t type, uint16_t priority,
task->func = func; task->func = func;
task->data = data; task->data = data;
return schedulers[task->type]->schedule_task_init(task, xflags); if (schedulers[task->type]->schedule_task_init)
return schedulers[task->type]->schedule_task_init(task, xflags);
else
return -ENOENT;
} }
void schedule_task(struct task *task, uint64_t start, uint64_t deadline, void schedule_task(struct task *task, uint64_t start, uint64_t deadline,